Git Product home page Git Product logo

galaxy-seo-package's Introduction

Galaxy SEO Support

Makes use of the built-in SEO support in Galaxy. If your app qualifies for SEO support, run:

meteor add mdg:seo

to turn on the built-in Prerender.io integration. You may also use this package with non-Galaxy deployments if you configure it manually.

This package is a thin wrapper around the prerender-node npm module, which understands the configuration format used by Galaxy to provide apps with a complimentary Prerender.io account. If you're not deploying to Galaxy, you may want to just use the npm module directly.

This package is based on a package previously released by Dominik Ferber as dferber:prerender (and older versions of this package simply depended on that package).

Manual configuration (non-Galaxy users)

In your settings.json file, include:

{
  "PrerenderIO": {
    "serviceUrl": "http://localhost:3033/",
    "token": "yourtoken"
  }
}

The serviceURL is optional and only used to test the Prerender server locally. Leave it out in your production configuration.

NOTICE: You may also provide the above credentials using environment variables, namely PRERENDERIO_TOKEN and PRERENDERIO_SERVICE_URL. They precede the configuration from the settings file.

Testing and Verifying

There are two options to test whether Prerender is working or not.

Locally (recommended)

  1. Set the serviceUrl to http://localhost:3033/.
  2. Download the open source Prerender server to another directory
  3. Run the Prerender server with a custom port locally (because 3000 is taken by your Meteor app), with $ PORT=3033 node server.js
  4. Visit any URL of your application and append ?_escaped_fragment_=, e.g. http://localhost:3000/?escaped_fragment= (perhaps using curl instead of a browser)

This will show you the version Prerender generated and search engines will see. You can view logs in the running prerender server which is quite helpful.

Using the Prerender service

  1. Set the serviceUrl to http://service.prerender.io/.
  2. Visit any URL of your application and append ?_escaped_fragment_=, e.g. http://localhost:3000/?escaped_fragment=
  3. See what is reported to Prerender at https://prerender.io/,

For more options, take a look at the prerender-node package.

Delaying the rendering

Sometimes the content will not show up immediately and all Prerender sees are loading spinners. This happens because Prerender uses the HTML too early, while the subscriptions are still loading.

Set window.prerenderReady = false; in the client side code. This will tell Prerender to wait. When your content is loaded, set it to true and Prerender will use that version. It's also possible to never set it to true. The request will then time out after about 20 seconds and Prerender will use whatever is on the screen.

Possible Errors

Error: connect ECONNREFUSED
    at errnoException (net.js:905:11)
    at Object.afterConnect [as oncomplete] (net.js:896:19)

If you get this error, you probably forgot to run your local Prerender server.

Contributions

Thanks to @dferber90 for the [dferber:prerender] package which this is based on. Thanks to @electricjesus and @dfischer for a previous version. Thanks to @arunoda for simplifying prerender-node.

galaxy-seo-package's People

Contributors

glasser avatar tmeasday avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.