Skip to content

Commit e6127c6

Browse files
committed
seo tutorial
1 parent 9e39e4b commit e6127c6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

_posts/2012-8-1-seo-for-single-page-apps.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,20 @@ page.onResourceRequested = function (request) {
9494
requestCount++;
9595
}
9696
};
97-
page.open(system.args[1], function () {
9897

99-
});
98+
// Open the page
99+
page.open(system.args[1], function () {});
100100

101101
var checkComplete = function () {
102-
102+
// We don't allow it to take longer than 5 seconds but
103+
// don't return until all requests are finished
103104
if((new Date().getTime() - lastReceived > 300 && requestCount === responseCount) || new Date().getTime() - startTime > 5000) {
104105
clearInterval(checkCompleteInterval);
105106
console.log(page.content);
106107
phantom.exit();
107108
}
108109
}
110+
// Let us check to see if the page is finished rendering
109111
var checkCompleteInterval = setInterval(checkComplete, 1);
110112
{% endhighlight %}
111113

@@ -121,10 +123,10 @@ RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
121123
RewriteRule (.*) http://webserver:3000/%1? [P]
122124
{% endhighlight %}
123125

124-
We could also include other RewriteCond, such as user agent to redirect other search engines we wish to be indexed on.
126+
We could also include other `RewriteCond`, such as `user agent` to redirect other search engines we wish to be indexed on.
125127

126128

127-
Though Google won't use query string unless we tell it to by either including a meta tag;
129+
Though Google won't use `_escaped_fragment_` unless we tell it to by either including a meta tag;
128130
`<meta name="fragment" content="!">`
129131
or
130132
using `#!` url's in our links.

0 commit comments

Comments
 (0)