308 lines
16 KiB
Python
308 lines
16 KiB
Python
# -*- coding:utf-8 -*-
|
|
from mako import runtime, filters, cache
|
|
UNDEFINED = runtime.UNDEFINED
|
|
__M_dict_builtin = dict
|
|
__M_locals_builtin = locals
|
|
_magic_number = 10
|
|
_modified_time = 1434096007.80396
|
|
_enable_loop = True
|
|
_template_filename = 'themes/bootstrap3/templates/base_helper.tmpl'
|
|
_template_uri = 'base_helper.tmpl'
|
|
_source_encoding = 'utf-8'
|
|
_exports = ['html_translations', 'html_feedlinks', 'late_load_js', 'html_stylesheets', 'html_headstart', 'html_navigation_links']
|
|
|
|
|
|
def render_body(context,**pageargs):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
__M_locals = __M_dict_builtin(pageargs=pageargs)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
__M_writer('\n\n')
|
|
__M_writer('\n\n\n')
|
|
__M_writer('\n\n')
|
|
__M_writer('\n\n')
|
|
__M_writer('\n\n')
|
|
__M_writer('\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_html_translations(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
messages = context.get('messages', UNDEFINED)
|
|
_link = context.get('_link', UNDEFINED)
|
|
translations = context.get('translations', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
for langname in translations.keys():
|
|
if langname != lang:
|
|
__M_writer(' <li><a href="')
|
|
__M_writer(str(_link("index", None, langname)))
|
|
__M_writer('" rel="alternate" hreflang="')
|
|
__M_writer(str(langname))
|
|
__M_writer('">')
|
|
__M_writer(str(messages("LANGUAGE", langname)))
|
|
__M_writer('</a></li>\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_html_feedlinks(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
rss_link = context.get('rss_link', UNDEFINED)
|
|
generate_rss = context.get('generate_rss', UNDEFINED)
|
|
_link = context.get('_link', UNDEFINED)
|
|
len = context.get('len', UNDEFINED)
|
|
translations = context.get('translations', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
if rss_link:
|
|
__M_writer(' ')
|
|
__M_writer(str(rss_link))
|
|
__M_writer('\n')
|
|
elif generate_rss:
|
|
if len(translations) > 1:
|
|
for language in translations:
|
|
__M_writer(' <link rel="alternate" type="application/rss+xml" title="RSS (')
|
|
__M_writer(str(language))
|
|
__M_writer(')" href="')
|
|
__M_writer(str(_link('rss', None, language)))
|
|
__M_writer('">\n')
|
|
else:
|
|
__M_writer(' <link rel="alternate" type="application/rss+xml" title="RSS" href="')
|
|
__M_writer(str(_link('rss', None)))
|
|
__M_writer('">\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_late_load_js(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
social_buttons_code = context.get('social_buttons_code', UNDEFINED)
|
|
use_cdn = context.get('use_cdn', UNDEFINED)
|
|
colorbox_locales = context.get('colorbox_locales', UNDEFINED)
|
|
use_bundles = context.get('use_bundles', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
if use_bundles:
|
|
if use_cdn:
|
|
__M_writer(' <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>\n <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>\n <script src="/assets/js/all.js"></script>\n')
|
|
else:
|
|
__M_writer(' <script src="/assets/js/all-nocdn.js"></script>\n')
|
|
else:
|
|
if use_cdn:
|
|
__M_writer(' <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>\n <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>\n')
|
|
else:
|
|
__M_writer(' <script src="/assets/js/jquery.min.js"></script>\n <script src="/assets/js/bootstrap.min.js"></script>\n <script src="/assets/js/moment-with-locales.min.js"></script>\n <script src="/assets/js/fancydates.js"></script>\n')
|
|
__M_writer(' <script src="/assets/js/jquery.colorbox-min.js"></script>\n')
|
|
if colorbox_locales[lang]:
|
|
__M_writer(' <script src="/assets/js/colorbox-i18n/jquery.colorbox-')
|
|
__M_writer(str(colorbox_locales[lang]))
|
|
__M_writer('.js"></script>\n')
|
|
__M_writer(' ')
|
|
__M_writer(str(social_buttons_code))
|
|
__M_writer('\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_html_stylesheets(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
post = context.get('post', UNDEFINED)
|
|
annotations = context.get('annotations', UNDEFINED)
|
|
notes = context.get('notes', UNDEFINED)
|
|
use_cdn = context.get('use_cdn', UNDEFINED)
|
|
has_custom_css = context.get('has_custom_css', UNDEFINED)
|
|
use_bundles = context.get('use_bundles', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
if use_bundles:
|
|
if use_cdn:
|
|
__M_writer(' <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">\n <link href="/assets/css/all.css" rel="stylesheet" type="text/css">\n')
|
|
else:
|
|
__M_writer(' <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">\n')
|
|
else:
|
|
if use_cdn:
|
|
__M_writer(' <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">\n')
|
|
else:
|
|
__M_writer(' <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">\n')
|
|
__M_writer(' <link href="/assets/css/rst.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/code.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/colorbox.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/theme.css" rel="stylesheet" type="text/css">\n')
|
|
if has_custom_css:
|
|
__M_writer(' <link href="/assets/css/custom.css" rel="stylesheet" type="text/css">\n')
|
|
if annotations and post and not post.meta('noannotations'):
|
|
__M_writer(' ')
|
|
__M_writer(str(notes.css()))
|
|
__M_writer('\n')
|
|
elif not annotations and post and post.meta('annotations'):
|
|
__M_writer(' ')
|
|
__M_writer(str(notes.css()))
|
|
__M_writer('\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_html_headstart(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
abs_link = context.get('abs_link', UNDEFINED)
|
|
nextlink = context.get('nextlink', UNDEFINED)
|
|
is_rtl = context.get('is_rtl', UNDEFINED)
|
|
title = context.get('title', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
mathjax_config = context.get('mathjax_config', UNDEFINED)
|
|
favicons = context.get('favicons', UNDEFINED)
|
|
def html_stylesheets():
|
|
return render_html_stylesheets(context)
|
|
use_cdn = context.get('use_cdn', UNDEFINED)
|
|
url_replacer = context.get('url_replacer', UNDEFINED)
|
|
twitter_card = context.get('twitter_card', UNDEFINED)
|
|
prevlink = context.get('prevlink', UNDEFINED)
|
|
comment_system = context.get('comment_system', UNDEFINED)
|
|
permalink = context.get('permalink', UNDEFINED)
|
|
use_open_graph = context.get('use_open_graph', UNDEFINED)
|
|
comment_system_id = context.get('comment_system_id', UNDEFINED)
|
|
striphtml = context.get('striphtml', UNDEFINED)
|
|
def html_feedlinks():
|
|
return render_html_feedlinks(context)
|
|
extra_head_data = context.get('extra_head_data', UNDEFINED)
|
|
description = context.get('description', UNDEFINED)
|
|
blog_title = context.get('blog_title', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n<!DOCTYPE html>\n<html\n')
|
|
if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook'):
|
|
__M_writer("prefix='")
|
|
if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
|
|
__M_writer('og: http://ogp.me/ns# ')
|
|
if use_open_graph:
|
|
__M_writer('article: http://ogp.me/ns/article# ')
|
|
if comment_system == 'facebook':
|
|
__M_writer('fb: http://ogp.me/ns/fb# ')
|
|
__M_writer("'")
|
|
if is_rtl:
|
|
__M_writer('dir="rtl" ')
|
|
__M_writer('lang="')
|
|
__M_writer(str(lang))
|
|
__M_writer('">\n <head>\n <meta charset="utf-8">\n')
|
|
if description:
|
|
__M_writer(' <meta name="description" content="')
|
|
__M_writer(str(description))
|
|
__M_writer('">\n')
|
|
__M_writer(' <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>')
|
|
__M_writer(striphtml(str(title)))
|
|
__M_writer(' | ')
|
|
__M_writer(striphtml(str(blog_title)))
|
|
__M_writer('</title>\n\n ')
|
|
__M_writer(str(html_stylesheets()))
|
|
__M_writer('\n ')
|
|
__M_writer(str(html_feedlinks()))
|
|
__M_writer('\n')
|
|
if permalink:
|
|
__M_writer(' <link rel="canonical" href="')
|
|
__M_writer(str(abs_link(permalink)))
|
|
__M_writer('">\n')
|
|
__M_writer('\n')
|
|
if favicons:
|
|
for name, file, size in favicons:
|
|
__M_writer(' <link rel="')
|
|
__M_writer(str(name))
|
|
__M_writer('" href="')
|
|
__M_writer(str(file))
|
|
__M_writer('" sizes="')
|
|
__M_writer(str(size))
|
|
__M_writer('"/>\n')
|
|
__M_writer('\n')
|
|
if comment_system == 'facebook':
|
|
__M_writer(' <meta property="fb:app_id" content="')
|
|
__M_writer(str(comment_system_id))
|
|
__M_writer('">\n')
|
|
__M_writer('\n')
|
|
if prevlink:
|
|
__M_writer(' <link rel="prev" href="')
|
|
__M_writer(str(prevlink))
|
|
__M_writer('" type="text/html">\n')
|
|
if nextlink:
|
|
__M_writer(' <link rel="next" href="')
|
|
__M_writer(str(nextlink))
|
|
__M_writer('" type="text/html">\n')
|
|
__M_writer('\n ')
|
|
__M_writer(str(mathjax_config))
|
|
__M_writer('\n')
|
|
if use_cdn:
|
|
__M_writer(' <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->\n')
|
|
else:
|
|
__M_writer(' <!--[if lt IE 9]><script src="')
|
|
__M_writer(str(url_replacer(permalink, '/assets/js/html5.js', lang)))
|
|
__M_writer('"></script><![endif]-->\n')
|
|
__M_writer('\n ')
|
|
__M_writer(str(extra_head_data))
|
|
__M_writer('\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_html_navigation_links(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
permalink = context.get('permalink', UNDEFINED)
|
|
isinstance = context.get('isinstance', UNDEFINED)
|
|
tuple = context.get('tuple', UNDEFINED)
|
|
navigation_links = context.get('navigation_links', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
rel_link = context.get('rel_link', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
for url, text in navigation_links[lang]:
|
|
if isinstance(url, tuple):
|
|
__M_writer(' <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">')
|
|
__M_writer(str(text))
|
|
__M_writer('<b class="caret"></b></a>\n <ul class="dropdown-menu">\n')
|
|
for suburl, text in url:
|
|
if rel_link(permalink, suburl) == "#":
|
|
__M_writer(' <li class="active"><a href="')
|
|
__M_writer(str(permalink))
|
|
__M_writer('">')
|
|
__M_writer(str(text))
|
|
__M_writer('</a>\n')
|
|
else:
|
|
__M_writer(' <li><a href="')
|
|
__M_writer(str(suburl))
|
|
__M_writer('">')
|
|
__M_writer(str(text))
|
|
__M_writer('</a>\n')
|
|
__M_writer(' </ul>\n')
|
|
else:
|
|
if rel_link(permalink, url) == "#":
|
|
__M_writer(' <li class="active"><a href="')
|
|
__M_writer(str(permalink))
|
|
__M_writer('">')
|
|
__M_writer(str(text))
|
|
__M_writer('</a>\n')
|
|
else:
|
|
__M_writer(' <li><a href="')
|
|
__M_writer(str(url))
|
|
__M_writer('">')
|
|
__M_writer(str(text))
|
|
__M_writer('</a>\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
"""
|
|
__M_BEGIN_METADATA
|
|
{"source_encoding": "utf-8", "line_map": {"15": 0, "20": 2, "21": 65, "22": 92, "23": 122, "24": 145, "25": 159, "26": 167, "32": 161, "40": 161, "41": 162, "42": 163, "43": 164, "44": 164, "45": 164, "46": 164, "47": 164, "48": 164, "49": 164, "55": 147, "64": 147, "65": 148, "66": 149, "67": 149, "68": 149, "69": 150, "70": 151, "71": 152, "72": 153, "73": 153, "74": 153, "75": 153, "76": 153, "77": 155, "78": 156, "79": 156, "80": 156, "86": 67, "95": 67, "96": 68, "97": 69, "98": 70, "99": 73, "100": 74, "101": 76, "102": 77, "103": 78, "104": 80, "105": 81, "106": 86, "107": 88, "108": 89, "109": 89, "110": 89, "111": 91, "112": 91, "113": 91, "119": 95, "129": 95, "130": 96, "131": 97, "132": 98, "133": 100, "134": 101, "135": 103, "136": 104, "137": 105, "138": 106, "139": 107, "140": 109, "141": 113, "142": 114, "143": 117, "144": 118, "145": 118, "146": 118, "147": 119, "148": 120, "149": 120, "150": 120, "156": 3, "183": 3, "184": 7, "185": 8, "186": 9, "187": 10, "188": 12, "189": 13, "190": 15, "191": 16, "192": 18, "193": 21, "194": 22, "195": 25, "196": 25, "197": 25, "198": 28, "199": 29, "200": 29, "201": 29, "202": 31, "203": 32, "204": 32, "205": 32, "206": 32, "207": 34, "208": 34, "209": 35, "210": 35, "211": 36, "212": 37, "213": 37, "214": 37, "215": 39, "216": 40, "217": 41, "218": 42, "219": 42, "220": 42, "221": 42, "222": 42, "223": 42, "224": 42, "225": 45, "226": 46, "227": 47, "228": 47, "229": 47, "230": 49, "231": 50, "232": 51, "233": 51, "234": 51, "235": 53, "236": 54, "237": 54, "238": 54, "239": 56, "240": 57, "241": 57, "242": 58, "243": 59, "244": 60, "245": 61, "246": 61, "247": 61, "248": 63, "249": 64, "250": 64, "256": 124, "266": 124, "267": 125, "268": 126, "269": 127, "270": 127, "271": 127, "272": 129, "273": 130, "274": 131, "275": 131, "276": 131, "277": 131, "278": 131, "279": 132, "280": 133, "281": 133, "282": 133, "283": 133, "284": 133, "285": 136, "286": 137, "287": 138, "288": 139, "289": 139, "290": 139, "291": 139, "292": 139, "293": 140, "294": 141, "295": 141, "296": 141, "297": 141, "298": 141, "304": 298}, "uri": "base_helper.tmpl", "filename": "themes/bootstrap3/templates/base_helper.tmpl"}
|
|
__M_END_METADATA
|
|
"""
|