chore(docs): support _escaped_fragment_ hack for crawler

This commit is contained in:
Igor Minar 2012-08-25 02:30:55 -07:00
parent 60a12b4161
commit 54895fc2a1
3 changed files with 21 additions and 3 deletions

View file

@ -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': ''}));
@ -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'));
}

View file

@ -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

View file

@ -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)])