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 = 1433919607.0189033
|
|
_enable_loop = True
|
|
_template_filename = 'themes/bootstrap3/templates/base_helper.tmpl'
|
|
_template_uri = 'base_helper.tmpl'
|
|
_source_encoding = 'utf-8'
|
|
_exports = ['html_navigation_links', 'html_headstart', 'html_feedlinks', 'late_load_js', 'html_stylesheets', 'html_translations']
|
|
|
|
|
|
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_navigation_links(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
permalink = context.get('permalink', UNDEFINED)
|
|
rel_link = context.get('rel_link', UNDEFINED)
|
|
tuple = context.get('tuple', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
isinstance = context.get('isinstance', UNDEFINED)
|
|
navigation_links = context.get('navigation_links', 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()
|
|
|
|
|
|
def render_html_headstart(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
nextlink = context.get('nextlink', UNDEFINED)
|
|
permalink = context.get('permalink', UNDEFINED)
|
|
prevlink = context.get('prevlink', UNDEFINED)
|
|
title = context.get('title', UNDEFINED)
|
|
striphtml = context.get('striphtml', UNDEFINED)
|
|
mathjax_config = context.get('mathjax_config', UNDEFINED)
|
|
comment_system = context.get('comment_system', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
def html_feedlinks():
|
|
return render_html_feedlinks(context)
|
|
use_cdn = context.get('use_cdn', UNDEFINED)
|
|
def html_stylesheets():
|
|
return render_html_stylesheets(context)
|
|
comment_system_id = context.get('comment_system_id', UNDEFINED)
|
|
blog_title = context.get('blog_title', UNDEFINED)
|
|
url_replacer = context.get('url_replacer', UNDEFINED)
|
|
extra_head_data = context.get('extra_head_data', UNDEFINED)
|
|
is_rtl = context.get('is_rtl', UNDEFINED)
|
|
description = context.get('description', UNDEFINED)
|
|
twitter_card = context.get('twitter_card', UNDEFINED)
|
|
use_open_graph = context.get('use_open_graph', UNDEFINED)
|
|
abs_link = context.get('abs_link', UNDEFINED)
|
|
favicons = context.get('favicons', 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_feedlinks(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
generate_rss = context.get('generate_rss', UNDEFINED)
|
|
len = context.get('len', UNDEFINED)
|
|
_link = context.get('_link', UNDEFINED)
|
|
rss_link = context.get('rss_link', 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:
|
|
use_cdn = context.get('use_cdn', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
use_bundles = context.get('use_bundles', UNDEFINED)
|
|
colorbox_locales = context.get('colorbox_locales', UNDEFINED)
|
|
social_buttons_code = context.get('social_buttons_code', 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:
|
|
notes = context.get('notes', UNDEFINED)
|
|
use_cdn = context.get('use_cdn', UNDEFINED)
|
|
has_custom_css = context.get('has_custom_css', UNDEFINED)
|
|
annotations = context.get('annotations', UNDEFINED)
|
|
post = context.get('post', 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_translations(context):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
_link = context.get('_link', UNDEFINED)
|
|
messages = context.get('messages', UNDEFINED)
|
|
lang = context.get('lang', UNDEFINED)
|
|
translations = context.get('translations', 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()
|
|
|
|
|
|
"""
|
|
__M_BEGIN_METADATA
|
|
{"line_map": {"15": 0, "20": 2, "21": 65, "22": 92, "23": 122, "24": 145, "25": 159, "26": 167, "32": 124, "42": 124, "43": 125, "44": 126, "45": 127, "46": 127, "47": 127, "48": 129, "49": 130, "50": 131, "51": 131, "52": 131, "53": 131, "54": 131, "55": 132, "56": 133, "57": 133, "58": 133, "59": 133, "60": 133, "61": 136, "62": 137, "63": 138, "64": 139, "65": 139, "66": 139, "67": 139, "68": 139, "69": 140, "70": 141, "71": 141, "72": 141, "73": 141, "74": 141, "80": 3, "107": 3, "108": 7, "109": 8, "110": 9, "111": 10, "112": 12, "113": 13, "114": 15, "115": 16, "116": 18, "117": 21, "118": 22, "119": 25, "120": 25, "121": 25, "122": 28, "123": 29, "124": 29, "125": 29, "126": 31, "127": 32, "128": 32, "129": 32, "130": 32, "131": 34, "132": 34, "133": 35, "134": 35, "135": 36, "136": 37, "137": 37, "138": 37, "139": 39, "140": 40, "141": 41, "142": 42, "143": 42, "144": 42, "145": 42, "146": 42, "147": 42, "148": 42, "149": 45, "150": 46, "151": 47, "152": 47, "153": 47, "154": 49, "155": 50, "156": 51, "157": 51, "158": 51, "159": 53, "160": 54, "161": 54, "162": 54, "163": 56, "164": 57, "165": 57, "166": 58, "167": 59, "168": 60, "169": 61, "170": 61, "171": 61, "172": 63, "173": 64, "174": 64, "180": 147, "189": 147, "190": 148, "191": 149, "192": 149, "193": 149, "194": 150, "195": 151, "196": 152, "197": 153, "198": 153, "199": 153, "200": 153, "201": 153, "202": 155, "203": 156, "204": 156, "205": 156, "211": 67, "220": 67, "221": 68, "222": 69, "223": 70, "224": 73, "225": 74, "226": 76, "227": 77, "228": 78, "229": 80, "230": 81, "231": 86, "232": 88, "233": 89, "234": 89, "235": 89, "236": 91, "237": 91, "238": 91, "244": 95, "254": 95, "255": 96, "256": 97, "257": 98, "258": 100, "259": 101, "260": 103, "261": 104, "262": 105, "263": 106, "264": 107, "265": 109, "266": 113, "267": 114, "268": 117, "269": 118, "270": 118, "271": 118, "272": 119, "273": 120, "274": 120, "275": 120, "281": 161, "289": 161, "290": 162, "291": 163, "292": 164, "293": 164, "294": 164, "295": 164, "296": 164, "297": 164, "298": 164, "304": 298}, "uri": "base_helper.tmpl", "filename": "themes/bootstrap3/templates/base_helper.tmpl", "source_encoding": "utf-8"}
|
|
__M_END_METADATA
|
|
"""
|