www.duckland.org/cache/.mako.tmp/index.tmpl.py

170 lines
7.6 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 = 1433970007.368617
_enable_loop = True
_template_filename = '/usr/lib/python3.4/site-packages/nikola/data/themes/base/templates/index.tmpl'
_template_uri = 'index.tmpl'
_source_encoding = 'utf-8'
_exports = ['content_header', 'extra_head', 'content']
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='index_helper.tmpl', callables=None, calling_uri=_template_uri)
context.namespaces[(__name__, 'helper')] = 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)
date_format = context.get('date_format', UNDEFINED)
index_file = context.get('index_file', UNDEFINED)
def content_header():
return render_content_header(context._locals(__M_locals))
comments = _mako_get_namespace(context, 'comments')
def content():
return render_content(context._locals(__M_locals))
site_has_comments = context.get('site_has_comments', UNDEFINED)
posts = context.get('posts', UNDEFINED)
permalink = context.get('permalink', UNDEFINED)
parent = context.get('parent', UNDEFINED)
def extra_head():
return render_extra_head(context._locals(__M_locals))
index_teasers = context.get('index_teasers', UNDEFINED)
helper = _mako_get_namespace(context, 'helper')
__M_writer = context.writer()
__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')
return ''
finally:
context.caller_stack._pop_frame()
def render_content_header(context,**pageargs):
__M_caller = context.caller_stack._push_frame()
try:
def content_header():
return render_content_header(context)
__M_writer = context.writer()
return ''
finally:
context.caller_stack._pop_frame()
def render_extra_head(context,**pageargs):
__M_caller = context.caller_stack._push_frame()
try:
posts = context.get('posts', UNDEFINED)
def extra_head():
return render_extra_head(context)
permalink = context.get('permalink', UNDEFINED)
index_file = context.get('index_file', UNDEFINED)
parent = context.get('parent', UNDEFINED)
__M_writer = context.writer()
__M_writer('\n ')
__M_writer(str(parent.extra_head()))
__M_writer('\n')
if posts and (permalink == '/' or permalink == '/' + index_file):
__M_writer(' <link rel="prefetch" href="')
__M_writer(str(posts[0].permalink()))
__M_writer('" type="text/html">\n')
return ''
finally:
context.caller_stack._pop_frame()
def render_content(context,**pageargs):
__M_caller = context.caller_stack._push_frame()
try:
date_format = context.get('date_format', UNDEFINED)
def content_header():
return render_content_header(context)
comments = _mako_get_namespace(context, 'comments')
def content():
return render_content(context)
site_has_comments = context.get('site_has_comments', UNDEFINED)
posts = context.get('posts', UNDEFINED)
index_teasers = context.get('index_teasers', UNDEFINED)
helper = _mako_get_namespace(context, 'helper')
__M_writer = context.writer()
__M_writer('\n')
if 'parent' not in context._data or not hasattr(context._data['parent'], 'content_header'):
context['self'].content_header(**pageargs)
__M_writer('\n<div class="postindex">\n')
for post in posts:
__M_writer(' <article class="h-entry post-')
__M_writer(str(post.meta('type')))
__M_writer('">\n <header>\n <h1 class="p-name entry-title"><a href="')
__M_writer(str(post.permalink()))
__M_writer('" class="u-url">')
__M_writer(filters.html_escape(str(post.title())))
__M_writer('</a></h1>\n <div class="metadata">\n <p class="byline author vcard"><span class="byline-name fn">')
__M_writer(str(post.author()))
__M_writer('</span></p>\n <p class="dateline"><a href="')
__M_writer(str(post.permalink()))
__M_writer('" rel="bookmark"><time class="published dt-published" datetime="')
__M_writer(str(post.date.isoformat()))
__M_writer('" title="')
__M_writer(str(post.formatted_date(date_format)))
__M_writer('">')
__M_writer(str(post.formatted_date(date_format)))
__M_writer('</time></a></p>\n')
if not post.meta('nocomments') and site_has_comments:
__M_writer(' <p class="commentline">')
__M_writer(str(comments.comment_link(post.permalink(), post._base_path)))
__M_writer('\n')
__M_writer(' </div>\n </header>\n')
if index_teasers:
__M_writer(' <div class="p-summary entry-summary">\n ')
__M_writer(str(post.text(teaser_only=True)))
__M_writer('\n')
else:
__M_writer(' <div class="e-content entry-content">\n ')
__M_writer(str(post.text(teaser_only=False)))
__M_writer('\n')
__M_writer(' </div>\n </article>\n')
__M_writer('</div>\n')
__M_writer(str(helper.html_pager()))
__M_writer('\n')
__M_writer(str(comments.comment_link_script()))
__M_writer('\n')
__M_writer(str(helper.mathjax_script(posts)))
__M_writer('\n')
return ''
finally:
context.caller_stack._pop_frame()
"""
__M_BEGIN_METADATA
{"source_encoding": "utf-8", "uri": "index.tmpl", "line_map": {"128": 19, "129": 19, "130": 21, "131": 21, "132": 22, "133": 22, "134": 22, "135": 22, "136": 22, "137": 22, "138": 22, "139": 22, "140": 23, "141": 24, "142": 24, "143": 24, "144": 26, "145": 28, "146": 29, "147": 30, "148": 30, "149": 31, "22": 3, "151": 33, "152": 33, "25": 2, "154": 38, "155": 39, "156": 39, "157": 40, "150": 32, "31": 0, "160": 41, "166": 160, "51": 2, "52": 3, "53": 4, "58": 11, "159": 41, "63": 42, "69": 14, "158": 40, "80": 6, "90": 6, "91": 7, "92": 7, "93": 8, "94": 9, "95": 9, "96": 9, "102": 13, "116": 13, "153": 35, "121": 14, "122": 16, "123": 17, "124": 17, "125": 17, "126": 19, "127": 19}, "filename": "/usr/lib/python3.4/site-packages/nikola/data/themes/base/templates/index.tmpl"}
__M_END_METADATA
"""