Redirects for old spec URLs
This commit is contained in:
@ -12,11 +12,22 @@ from i2p2www.blog.helpers import get_blog_posts
|
||||
def main_index():
|
||||
return redirect(url_for('site_show', lang='en'))
|
||||
|
||||
SPEC_REDIRECTS = {
|
||||
'docs/how/cryptography': 'cryptography',
|
||||
}
|
||||
|
||||
# Site pages
|
||||
@cache.cached()
|
||||
def site_show(page):
|
||||
if page.endswith('.html'):
|
||||
return redirect(url_for('site_show', page=page[:-5]))
|
||||
|
||||
# Redirect for old spec pages
|
||||
if page.startswith('docs/spec/'):
|
||||
return redirect(url_for('spec_show', name=page[10:]))
|
||||
if page in SPEC_REDIRECTS:
|
||||
return redirect(url_for('spec_show', name=SPEC_REDIRECTS[page]))
|
||||
|
||||
name = 'site/%s.html' % page
|
||||
page_file = safe_join(TEMPLATE_DIR, name)
|
||||
|
||||
|
Reference in New Issue
Block a user