188 lines
8.4 KiB
Python
188 lines
8.4 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 = 1434031207.88354
|
|
_enable_loop = True
|
|
_template_filename = 'themes/bootstrap/templates/post.tmpl'
|
|
_template_uri = 'post.tmpl'
|
|
_source_encoding = 'utf-8'
|
|
_exports = ['content', 'extra_head', 'sourcelink']
|
|
|
|
|
|
def _mako_get_namespace(context, name):
|
|
try:
|
|
return context.namespaces[(__name__, name)]
|
|
except KeyError:
|
|
_mako_generate_namespaces(context)
|
|
return context.namespaces[(__name__, name)]
|
|
def _mako_generate_namespaces(context):
|
|
ns = runtime.TemplateNamespace('comments', context._clean_inheritance_tokens(), templateuri='comments_helper.tmpl', callables=None, calling_uri=_template_uri)
|
|
context.namespaces[(__name__, 'comments')] = ns
|
|
|
|
ns = runtime.TemplateNamespace('helper', context._clean_inheritance_tokens(), templateuri='post_helper.tmpl', callables=None, calling_uri=_template_uri)
|
|
context.namespaces[(__name__, 'helper')] = ns
|
|
|
|
ns = runtime.TemplateNamespace('pheader', context._clean_inheritance_tokens(), templateuri='post_header.tmpl', callables=None, calling_uri=_template_uri)
|
|
context.namespaces[(__name__, 'pheader')] = ns
|
|
|
|
def _mako_inherit(template, context):
|
|
_mako_generate_namespaces(context)
|
|
return runtime._inherit_from(context, 'base.tmpl', _template_uri)
|
|
def render_body(context,**pageargs):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
__M_locals = __M_dict_builtin(pageargs=pageargs)
|
|
def content():
|
|
return render_content(context._locals(__M_locals))
|
|
def sourcelink():
|
|
return render_sourcelink(context._locals(__M_locals))
|
|
messages = context.get('messages', UNDEFINED)
|
|
comments = _mako_get_namespace(context, 'comments')
|
|
parent = context.get('parent', UNDEFINED)
|
|
def extra_head():
|
|
return render_extra_head(context._locals(__M_locals))
|
|
site_has_comments = context.get('site_has_comments', UNDEFINED)
|
|
post = context.get('post', UNDEFINED)
|
|
helper = _mako_get_namespace(context, 'helper')
|
|
pheader = _mako_get_namespace(context, 'pheader')
|
|
show_sourcelink = context.get('show_sourcelink', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
__M_writer('\n')
|
|
__M_writer('\n')
|
|
__M_writer('\n\n')
|
|
if 'parent' not in context._data or not hasattr(context._data['parent'], 'extra_head'):
|
|
context['self'].extra_head(**pageargs)
|
|
|
|
|
|
__M_writer('\n\n')
|
|
if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
|
|
context['self'].content(**pageargs)
|
|
|
|
|
|
__M_writer('\n\n')
|
|
if 'parent' not in context._data or not hasattr(context._data['parent'], 'sourcelink'):
|
|
context['self'].sourcelink(**pageargs)
|
|
|
|
|
|
__M_writer('\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_content(context,**pageargs):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
def content():
|
|
return render_content(context)
|
|
site_has_comments = context.get('site_has_comments', UNDEFINED)
|
|
messages = context.get('messages', UNDEFINED)
|
|
comments = _mako_get_namespace(context, 'comments')
|
|
post = context.get('post', UNDEFINED)
|
|
helper = _mako_get_namespace(context, 'helper')
|
|
pheader = _mako_get_namespace(context, 'pheader')
|
|
__M_writer = context.writer()
|
|
__M_writer('\n<article class="post-')
|
|
__M_writer(str(post.meta('type')))
|
|
__M_writer(' h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article">\n ')
|
|
__M_writer(str(pheader.html_post_header()))
|
|
__M_writer('\n <div class="e-content entry-content" itemprop="articleBody text">\n ')
|
|
__M_writer(str(post.text()))
|
|
__M_writer('\n </div>\n <aside class="postpromonav">\n <nav>\n ')
|
|
__M_writer(str(helper.html_tags(post)))
|
|
__M_writer('\n ')
|
|
__M_writer(str(helper.html_pager(post)))
|
|
__M_writer('\n </nav>\n </aside>\n')
|
|
if not post.meta('nocomments') and site_has_comments:
|
|
__M_writer(' <section class="comments">\n <h2>')
|
|
__M_writer(str(messages("Comments")))
|
|
__M_writer('</h2>\n ')
|
|
__M_writer(str(comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)))
|
|
__M_writer('\n </section>\n')
|
|
__M_writer(' ')
|
|
__M_writer(str(helper.mathjax_script(post)))
|
|
__M_writer('\n</article>\n')
|
|
__M_writer(str(comments.comment_link_script()))
|
|
__M_writer('\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_extra_head(context,**pageargs):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
parent = context.get('parent', UNDEFINED)
|
|
post = context.get('post', UNDEFINED)
|
|
def extra_head():
|
|
return render_extra_head(context)
|
|
helper = _mako_get_namespace(context, 'helper')
|
|
__M_writer = context.writer()
|
|
__M_writer('\n ')
|
|
__M_writer(str(parent.extra_head()))
|
|
__M_writer('\n')
|
|
if post.meta('keywords'):
|
|
__M_writer(' <meta name="keywords" content="')
|
|
__M_writer(filters.html_escape(str(post.meta('keywords'))))
|
|
__M_writer('">\n')
|
|
if post.description():
|
|
__M_writer(' <meta name="description" itemprop="description" content="')
|
|
__M_writer(str(post.description()))
|
|
__M_writer('">\n')
|
|
__M_writer(' <meta name="author" content="')
|
|
__M_writer(str(post.author()))
|
|
__M_writer('">\n')
|
|
if post.prev_post:
|
|
__M_writer(' <link rel="prev" href="')
|
|
__M_writer(str(post.prev_post.permalink()))
|
|
__M_writer('" title="')
|
|
__M_writer(str(post.prev_post.title()))
|
|
__M_writer('" type="text/html">\n')
|
|
if post.next_post:
|
|
__M_writer(' <link rel="next" href="')
|
|
__M_writer(str(post.next_post.permalink()))
|
|
__M_writer('" title="')
|
|
__M_writer(str(post.next_post.title()))
|
|
__M_writer('" type="text/html">\n')
|
|
__M_writer(' ')
|
|
__M_writer(str(helper.open_graph_metadata(post)))
|
|
__M_writer('\n ')
|
|
__M_writer(str(helper.twitter_card_information(post)))
|
|
__M_writer('\n ')
|
|
__M_writer(str(helper.meta_translations(post)))
|
|
__M_writer('\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
def render_sourcelink(context,**pageargs):
|
|
__M_caller = context.caller_stack._push_frame()
|
|
try:
|
|
post = context.get('post', UNDEFINED)
|
|
messages = context.get('messages', UNDEFINED)
|
|
def sourcelink():
|
|
return render_sourcelink(context)
|
|
show_sourcelink = context.get('show_sourcelink', UNDEFINED)
|
|
__M_writer = context.writer()
|
|
__M_writer('\n')
|
|
if show_sourcelink:
|
|
__M_writer(' <li>\n <a href="')
|
|
__M_writer(str(post.source_link()))
|
|
__M_writer('" id="sourcelink">')
|
|
__M_writer(str(messages("Source")))
|
|
__M_writer('</a>\n </li>\n')
|
|
return ''
|
|
finally:
|
|
context.caller_stack._pop_frame()
|
|
|
|
|
|
"""
|
|
__M_BEGIN_METADATA
|
|
{"filename": "themes/bootstrap/templates/post.tmpl", "uri": "post.tmpl", "source_encoding": "utf-8", "line_map": {"128": 9, "129": 10, "130": 10, "131": 10, "132": 12, "133": 13, "134": 13, "135": 13, "136": 15, "137": 15, "138": 15, "139": 16, "140": 17, "141": 17, "142": 17, "143": 17, "144": 17, "145": 19, "146": 20, "147": 20, "148": 20, "149": 20, "22": 4, "151": 22, "152": 22, "25": 2, "154": 23, "155": 23, "28": 3, "157": 24, "150": 20, "34": 0, "163": 50, "156": 24, "172": 50, "173": 51, "174": 52, "175": 53, "176": 53, "177": 53, "178": 53, "53": 2, "54": 3, "55": 4, "56": 5, "61": 25, "66": 48, "71": 56, "77": 27, "184": 178, "89": 27, "90": 28, "91": 28, "92": 29, "93": 29, "94": 31, "95": 31, "96": 35, "97": 35, "98": 36, "99": 36, "100": 39, "101": 40, "102": 41, "103": 41, "104": 42, "105": 42, "106": 45, "107": 45, "108": 45, "109": 47, "110": 47, "116": 7, "153": 22, "125": 7, "126": 8, "127": 8}}
|
|
__M_END_METADATA
|
|
"""
|