Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Commit

Permalink
chore(docs): support _escaped_fragment_ hack for crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Aug 25, 2012
1 parent 4a4b28d commit f7ac8ef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/src/gen-docs.js
Expand Up @@ -54,7 +54,7 @@ function writeTheRest(writesFuture) {


writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-jq.html',
writer.replace, {'doc:manifest': manifest}));
writer.replace, {'doc:manifest': ''}));

writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-jq-nocache.html',
writer.replace, {'doc:manifest': ''}));
Expand Down Expand Up @@ -94,6 +94,7 @@ function writeTheRest(writesFuture) {
writesFuture.push(writer.copyTpl('app.yaml'));
writesFuture.push(writer.copyTpl('index.yaml'));
writesFuture.push(writer.copyTpl('favicon.ico'));
writesFuture.push(writer.copyTpl('main.py'));
}


Expand Down
3 changes: 1 addition & 2 deletions docs/src/templates/app.yaml
Expand Up @@ -7,8 +7,7 @@ default_expiration: "2h"

handlers:
- url: /
static_files: index.html
upload: index.html
script: main.app

- url: /appcache.manifest
static_files: appcache.manifest
Expand Down
18 changes: 18 additions & 0 deletions docs/src/templates/main.py
@@ -0,0 +1,18 @@
import webapp2
from google.appengine.ext.webapp import template


class IndexHandler(webapp2.RequestHandler):
def get(self):
fragment = self.request.get('_escaped_fragment_')

if fragment:
fragment = '/partials' + fragment + '.html'
self.redirect(fragment, permanent=True)
else:
self.response.headers['Content-Type'] = 'text/html'
self.response.out.write(template.render('index-nocache.html', None))


app = webapp2.WSGIApplication([('/', IndexHandler)])

0 comments on commit f7ac8ef

Please sign in to comment.