123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- # -*- coding:utf-8 -*-
- from mako import runtime, filters, cache
- UNDEFINED = runtime.UNDEFINED
- STOP_RENDERING = runtime.STOP_RENDERING
- __M_dict_builtin = dict
- __M_locals_builtin = locals
- _magic_number = 10
- _modified_time = 1676236796.1938248
- _enable_loop = True
- _template_filename = 'themes/bootblog/templates/base_helper.tmpl'
- _template_uri = 'base_helper.tmpl'
- _source_encoding = 'utf-8'
- _exports = ['html_headstart', 'late_load_js', 'html_stylesheets', 'html_navigation_links', 'html_feedlinks', '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\n\n')
- return ''
- finally:
- context.caller_stack._pop_frame()
-
-
- def render_html_headstart(context):
- __M_caller = context.caller_stack._push_frame()
- try:
- url_replacer = context.get('url_replacer', UNDEFINED)
- striphtml = context.get('striphtml', UNDEFINED)
- abs_link = context.get('abs_link', UNDEFINED)
- lang = context.get('lang', UNDEFINED)
- use_cdn = context.get('use_cdn', UNDEFINED)
- twitter_card = context.get('twitter_card', UNDEFINED)
- favicons = context.get('favicons', UNDEFINED)
- comment_system_id = context.get('comment_system_id', UNDEFINED)
- title = context.get('title', UNDEFINED)
- permalink = context.get('permalink', UNDEFINED)
- blog_title = context.get('blog_title', UNDEFINED)
- def html_stylesheets():
- return render_html_stylesheets(context)
- use_open_graph = context.get('use_open_graph', UNDEFINED)
- description = context.get('description', UNDEFINED)
- prevlink = context.get('prevlink', UNDEFINED)
- def html_feedlinks():
- return render_html_feedlinks(context)
- nextlink = context.get('nextlink', UNDEFINED)
- comment_system = context.get('comment_system', UNDEFINED)
- is_rtl = context.get('is_rtl', UNDEFINED)
- extra_head_data = context.get('extra_head_data', 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\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')
- 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_late_load_js(context):
- __M_caller = context.caller_stack._push_frame()
- try:
- use_cdn = context.get('use_cdn', UNDEFINED)
- social_buttons_code = context.get('social_buttons_code', UNDEFINED)
- use_bundles = context.get('use_bundles', UNDEFINED)
- __M_writer = context.writer()
- __M_writer('\n')
- if use_bundles:
- if use_cdn:
- __M_writer(' <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>\n <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>\n <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.js" integrity="sha256-SoEATAB7PgNWyyK100I7yQXYm5V08k5SFupDP0h72MY=" crossorigin="anonymous"></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.12.3/jquery.min.js"></script>\n <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/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/baguetteBox.min.js"></script>\n')
- __M_writer(' <script src="/assets/js/moment-with-locales.min.js"></script>\n <script src="/assets/js/fancydates.min.js"></script>\t\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:
- needs_ipython_css = context.get('needs_ipython_css', 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 rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />\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 rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />\n')
- else:
- __M_writer(' <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/baguetteBox.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/theme.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/blog.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 needs_ipython_css:
- __M_writer(' <link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">\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)
- lang = context.get('lang', UNDEFINED)
- navigation_links = context.get('navigation_links', UNDEFINED)
- messages = context.get('messages', UNDEFINED)
- __M_writer = context.writer()
- __M_writer('\n')
- for url, text in navigation_links[lang]:
- if rel_link(permalink, url) == "#":
- __M_writer(' <a href="')
- __M_writer(str(permalink))
- __M_writer('" class="blog-nav-item active">')
- __M_writer(str(text))
- __M_writer(' <span class="sr-only">')
- __M_writer(str(messages("(active)", lang)))
- __M_writer('</span></a>\n')
- else:
- __M_writer(' <a href="')
- __M_writer(str(url))
- __M_writer('" class="blog-nav-item">')
- __M_writer(str(text))
- __M_writer('</a>\n')
- return ''
- finally:
- context.caller_stack._pop_frame()
-
-
- def render_html_feedlinks(context):
- __M_caller = context.caller_stack._push_frame()
- try:
- len = context.get('len', UNDEFINED)
- generate_atom = context.get('generate_atom', UNDEFINED)
- _link = context.get('_link', UNDEFINED)
- rss_link = context.get('rss_link', UNDEFINED)
- translations = context.get('translations', UNDEFINED)
- generate_rss = context.get('generate_rss', 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')
- if generate_atom:
- if len(translations) > 1:
- for language in translations:
- __M_writer(' <link rel="alternate" type="application/atom+xml" title="Atom (')
- __M_writer(str(language))
- __M_writer(')" href="')
- __M_writer(str(_link('index_atom', None, language)))
- __M_writer('">\n')
- else:
- __M_writer(' <link rel="alternate" type="application/atom+xml" title="Atom" href="')
- __M_writer(str(_link('index_atom', None)))
- __M_writer('">\n')
- return ''
- finally:
- context.caller_stack._pop_frame()
-
-
- def render_html_translations(context):
- __M_caller = context.caller_stack._push_frame()
- try:
- abs_link = context.get('abs_link', UNDEFINED)
- lang = context.get('lang', UNDEFINED)
- _link = context.get('_link', UNDEFINED)
- messages = context.get('messages', UNDEFINED)
- translations = context.get('translations', UNDEFINED)
- __M_writer = context.writer()
- __M_writer('\n')
- for langname in translations.keys():
- if langname != lang:
- __M_writer(' <a class="blog-nav-item blog-nav-item-aside" href="')
- __M_writer(str(abs_link(_link("root", None, langname))))
- __M_writer('" rel="alternate" hreflang="')
- __M_writer(str(langname))
- __M_writer('">')
- __M_writer(str(messages("LANGUAGE", langname)))
- __M_writer('</a>\n')
- return ''
- finally:
- context.caller_stack._pop_frame()
-
-
- """
- __M_BEGIN_METADATA
- {"filename": "themes/bootblog/templates/base_helper.tmpl", "uri": "base_helper.tmpl", "source_encoding": "utf-8", "line_map": {"16": 0, "21": 2, "22": 66, "23": 91, "24": 123, "25": 133, "26": 156, "27": 164, "33": 3, "59": 3, "60": 7, "61": 8, "62": 9, "63": 10, "64": 12, "65": 13, "66": 15, "67": 16, "68": 18, "69": 21, "70": 22, "71": 25, "72": 25, "73": 25, "74": 28, "75": 29, "76": 29, "77": 29, "78": 31, "79": 32, "80": 32, "81": 32, "82": 32, "83": 36, "84": 36, "85": 37, "86": 37, "87": 38, "88": 39, "89": 39, "90": 39, "91": 41, "92": 42, "93": 43, "94": 44, "95": 44, "96": 44, "97": 44, "98": 44, "99": 44, "100": 44, "101": 47, "102": 48, "103": 49, "104": 49, "105": 49, "106": 51, "107": 52, "108": 53, "109": 53, "110": 53, "111": 55, "112": 56, "113": 56, "114": 56, "115": 58, "116": 59, "117": 60, "118": 61, "119": 62, "120": 62, "121": 62, "122": 64, "123": 65, "124": 65, "130": 68, "137": 68, "138": 69, "139": 70, "140": 71, "141": 75, "142": 76, "143": 78, "144": 79, "145": 80, "146": 82, "147": 83, "148": 87, "149": 90, "150": 90, "151": 90, "157": 94, "165": 94, "166": 95, "167": 96, "168": 97, "169": 100, "170": 101, "171": 103, "172": 104, "173": 105, "174": 107, "175": 108, "176": 111, "177": 115, "178": 116, "179": 119, "180": 120, "186": 125, "195": 125, "196": 126, "197": 127, "198": 128, "199": 128, "200": 128, "201": 128, "202": 128, "203": 128, "204": 128, "205": 129, "206": 130, "207": 130, "208": 130, "209": 130, "210": 130, "216": 135, "226": 135, "227": 136, "228": 137, "229": 137, "230": 137, "231": 138, "232": 139, "233": 140, "234": 141, "235": 141, "236": 141, "237": 141, "238": 141, "239": 143, "240": 144, "241": 144, "242": 144, "243": 147, "244": 148, "245": 149, "246": 150, "247": 150, "248": 150, "249": 150, "250": 150, "251": 152, "252": 153, "253": 153, "254": 153, "260": 158, "269": 158, "270": 159, "271": 160, "272": 161, "273": 161, "274": 161, "275": 161, "276": 161, "277": 161, "278": 161, "284": 278}}
- __M_END_METADATA
- """
|