diff --git a/README b/README new file mode 100644 index 0000000..38c9bbe --- /dev/null +++ b/README @@ -0,0 +1,46 @@ +

Welcome!

+

Seo Server is a command line tool that runs a server that allows GoogleBot(and any other crawlers) to crawl your heavily Javascript built websites. The tool works with very little changes to your server or client side code.

+

This entire site is driven by Javascript(view the source or see the code). Click the `What does Google see?` button at the bottom of each page to see Seo Server in action.

+ +

How it works

+

+

Seo Server runs PhantomJs(headless webkit browser) which renders the page fully and returns the fully executed code to GoogleBot.

+ +

Getting started

+

1) you must install PhantomJs(http://phantomjs.org/) and link into your bin so that Seo Server can call it.

+

2) Seo Server is an NPM module so install via

+ sudo npm install -g seoserver +

3) Now we have access to the Seo Server command line tool

+ seoserver start +

Which starts an Express server on port 3000 or

+ seoserver -p 4000 start +

Start it as a background process and log the output

+ seoserver -p 4000 start > seoserver.log & + +

Telling GoogleBot to fetch from Seo Server

+

To tell GoogleBot that we are using ajaxed content we simply add to our sites index.html file the Google specific meta tag. If you view the source of this page you can see we have included the tag below.

+ <meta name="fragment" content="!"> +

Now whenever GoogleBot visits any of our pages it will try to load ?_escaped_fragment_=pathname

+

So if we were using Apache with mod rewrite and mod proxy, we can include in our .htaccess

+ + RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
+ RewriteRule (.*) http://address-of-seoserver:3000/%1? [P] +
+

Now all request from GoogleBot will be returned fully rendered. How GoogleBot sees the page can be tested with Google WebMasters(they allow you to simulate Google crawls and see the result instantly).

+ +

For other crawlers

+

+ Using mod rewrite, we can send other crawlers to Seo Server also +

+ + RewriteCond %{HTTP_USER_AGENT} ^DuckDuckBot/1.0;
+ RewriteRule (.*) http://address-of-seoserver:3000/%1? [P] + +
+

FAQ

+

Nothing here yet, but check out the examples on the left to see different types of ajaxed content. Also ask questions and give feedback on GitHub issues. +


+ +
+ + diff --git a/css/theme.css b/css/theme.css index 8f39b41..9dfe435 100644 --- a/css/theme.css +++ b/css/theme.css @@ -3,6 +3,7 @@ width: 157px; height: 34px; background: url('../img/api-engine-logo_official.png'); + display: inline-block; } .showseo-output { @@ -17,4 +18,9 @@ code { body { overflow-y: scroll; +} + +h1 { + margin-left: 17px; +margin-bottom: 16px; } \ No newline at end of file diff --git a/js/main.js b/js/main.js index 0519110..467ff65 100644 --- a/js/main.js +++ b/js/main.js @@ -27,7 +27,7 @@ require([ 'clicky' ], function(AppView, Vm, Router, norefclicky){ // Some hackery to include clicky in our app - try{ clicky.init(203165); }catch(e){} + try{ clicky.init(100532051); }catch(e){} var appView = Vm.create({}, 'AppView', AppView); Router.initialize({appView: appView}); appView.render(); // render() calls Backbone.history when its ready to start diff --git a/templates/examples/json.html b/templates/examples/json.html index 6eb8d8b..3df3b66 100644 --- a/templates/examples/json.html +++ b/templates/examples/json.html @@ -1,6 +1,6 @@

JSON data with Javascript template

-

Pulling in data from stats.cdnjs.com (a CORS enabled API)

+

Pulling in data from stats.cdnjs.com (a CORS enabled API) from cdnjs.com

diff --git a/templates/home/page.html b/templates/home/page.html index dface85..339c0db 100644 --- a/templates/home/page.html +++ b/templates/home/page.html @@ -1,20 +1,22 @@

Welcome!

-

Seo Server is a command line tool that runs a server that allows GoogleBot(any any other crawlers) to crawl your heavily Javascript built websites. The tool works with very little changes to your server or client side code.

-

This entire site is driven by Javascript(view the source). Click the `What does Google see?` button at the bottom of each page to see Seo Server in action.

+

Seo Server is a command line tool that runs a server that allows GoogleBot(and any other crawlers) to crawl your heavily Javascript built websites. The tool works with very little changes to your server or client side code.

+

This entire site is driven by Javascript(view the source or see the code). Click the `What does Google see?` button at the bottom of each page to see Seo Server in action.

How it works



Seo Server runs PhantomJs(headless webkit browser) which renders the page fully and returns the fully executed code to GoogleBot.

Getting started

-

First you must install PhantomJs(http://phantomjs.org/) and link into your bin so that Seo Server can call it.

-

Seo Server is an NPM module so install via

+

1) you must install PhantomJs(http://phantomjs.org/) and link into your bin so that Seo Server can call it.

+

2) Seo Server is an NPM module so install via

sudo npm install -g seoserver -

Now we have access to the Seo Server command line tool

+

3) Now we have access to the Seo Server command line tool

seoserver start

Which starts an Express server on port 3000 or

seoserver -p 4000 start +

Start it as a background process and log the output

+ seoserver -p 4000 start > seoserver.log &

Telling GoogleBot to fetch from Seo Server

To tell GoogleBot that we are using ajaxed content we simply add to our sites index.html file the Google specific meta tag. If you view the source of this page you can see we have included the tag below.

diff --git a/templates/menu.html b/templates/menu.html index d28a334..e228b1a 100644 --- a/templates/menu.html +++ b/templates/menu.html @@ -8,6 +8,6 @@
LibraryWednesday's hits