mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 07:14:44 +00:00
chore(docs): support _escaped_fragment_ hack for crawler
This commit is contained in:
parent
60a12b4161
commit
54895fc2a1
3 changed files with 21 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ function writeTheRest(writesFuture) {
|
||||||
|
|
||||||
|
|
||||||
writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-jq.html',
|
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',
|
writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-jq-nocache.html',
|
||||||
writer.replace, {'doc:manifest': ''}));
|
writer.replace, {'doc:manifest': ''}));
|
||||||
|
|
@ -94,6 +94,7 @@ function writeTheRest(writesFuture) {
|
||||||
writesFuture.push(writer.copyTpl('app.yaml'));
|
writesFuture.push(writer.copyTpl('app.yaml'));
|
||||||
writesFuture.push(writer.copyTpl('index.yaml'));
|
writesFuture.push(writer.copyTpl('index.yaml'));
|
||||||
writesFuture.push(writer.copyTpl('favicon.ico'));
|
writesFuture.push(writer.copyTpl('favicon.ico'));
|
||||||
|
writesFuture.push(writer.copyTpl('main.py'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@ default_expiration: "2h"
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- url: /
|
- url: /
|
||||||
static_files: index.html
|
script: main.app
|
||||||
upload: index.html
|
|
||||||
|
|
||||||
- url: /appcache.manifest
|
- url: /appcache.manifest
|
||||||
static_files: 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)])
|
||||||
|
|
||||||
Loading…
Reference in a new issue