mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-12 22:35:30 +08:00
chore(docs): support _escaped_fragment_ hack for crawler
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
18
docs/src/templates/main.py
Normal file
18
docs/src/templates/main.py
Normal 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)])
|
||||
|
||||
Reference in New Issue
Block a user