A new Riff-radio.org site with a static approach.

index.tmpl.py 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # -*- coding:utf-8 -*-
  2. from mako import runtime, filters, cache
  3. UNDEFINED = runtime.UNDEFINED
  4. STOP_RENDERING = runtime.STOP_RENDERING
  5. __M_dict_builtin = dict
  6. __M_locals_builtin = locals
  7. _magic_number = 10
  8. _modified_time = 1676236796.3963673
  9. _enable_loop = True
  10. _template_filename = 'themes/bootblog/templates/index.tmpl'
  11. _template_uri = 'index.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['extra_head', 'content', 'content_header']
  14. def _mako_get_namespace(context, name):
  15. try:
  16. return context.namespaces[(__name__, name)]
  17. except KeyError:
  18. _mako_generate_namespaces(context)
  19. return context.namespaces[(__name__, name)]
  20. def _mako_generate_namespaces(context):
  21. ns = runtime.TemplateNamespace('helper', context._clean_inheritance_tokens(), templateuri='index_helper.tmpl', callables=None, calling_uri=_template_uri)
  22. context.namespaces[(__name__, 'helper')] = ns
  23. ns = runtime.TemplateNamespace('comments', context._clean_inheritance_tokens(), templateuri='comments_helper.tmpl', callables=None, calling_uri=_template_uri)
  24. context.namespaces[(__name__, 'comments')] = ns
  25. ns = runtime.TemplateNamespace('math', context._clean_inheritance_tokens(), templateuri='math_helper.tmpl', callables=None, calling_uri=_template_uri)
  26. context.namespaces[(__name__, 'math')] = ns
  27. def _mako_inherit(template, context):
  28. _mako_generate_namespaces(context)
  29. return runtime._inherit_from(context, 'base.tmpl', _template_uri)
  30. def render_body(context,**pageargs):
  31. __M_caller = context.caller_stack._push_frame()
  32. try:
  33. __M_locals = __M_dict_builtin(pageargs=pageargs)
  34. permalink = context.get('permalink', UNDEFINED)
  35. math = _mako_get_namespace(context, 'math')
  36. index_file = context.get('index_file', UNDEFINED)
  37. date_format = context.get('date_format', UNDEFINED)
  38. parent = context.get('parent', UNDEFINED)
  39. posts = context.get('posts', UNDEFINED)
  40. def extra_head():
  41. return render_extra_head(context._locals(__M_locals))
  42. comments = _mako_get_namespace(context, 'comments')
  43. index_teasers = context.get('index_teasers', UNDEFINED)
  44. def content_header():
  45. return render_content_header(context._locals(__M_locals))
  46. site_has_comments = context.get('site_has_comments', UNDEFINED)
  47. helper = _mako_get_namespace(context, 'helper')
  48. def content():
  49. return render_content(context._locals(__M_locals))
  50. __M_writer = context.writer()
  51. __M_writer('\n')
  52. __M_writer('\n')
  53. __M_writer('\n')
  54. __M_writer('\n\n')
  55. if 'parent' not in context._data or not hasattr(context._data['parent'], 'extra_head'):
  56. context['self'].extra_head(**pageargs)
  57. __M_writer('\n\n')
  58. if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
  59. context['self'].content(**pageargs)
  60. __M_writer('\n')
  61. return ''
  62. finally:
  63. context.caller_stack._pop_frame()
  64. def render_extra_head(context,**pageargs):
  65. __M_caller = context.caller_stack._push_frame()
  66. try:
  67. permalink = context.get('permalink', UNDEFINED)
  68. math = _mako_get_namespace(context, 'math')
  69. index_file = context.get('index_file', UNDEFINED)
  70. parent = context.get('parent', UNDEFINED)
  71. posts = context.get('posts', UNDEFINED)
  72. def extra_head():
  73. return render_extra_head(context)
  74. __M_writer = context.writer()
  75. __M_writer('\n ')
  76. __M_writer(str(parent.extra_head()))
  77. __M_writer('\n')
  78. if posts and (permalink == '/' or permalink == '/' + index_file):
  79. __M_writer(' <link rel="prefetch" href="')
  80. __M_writer(str(posts[0].permalink()))
  81. __M_writer('" type="text/html">\n')
  82. __M_writer(' ')
  83. __M_writer(str(math.math_styles_ifposts(posts)))
  84. __M_writer('\n')
  85. return ''
  86. finally:
  87. context.caller_stack._pop_frame()
  88. def render_content(context,**pageargs):
  89. __M_caller = context.caller_stack._push_frame()
  90. try:
  91. date_format = context.get('date_format', UNDEFINED)
  92. math = _mako_get_namespace(context, 'math')
  93. posts = context.get('posts', UNDEFINED)
  94. comments = _mako_get_namespace(context, 'comments')
  95. index_teasers = context.get('index_teasers', UNDEFINED)
  96. def content_header():
  97. return render_content_header(context)
  98. site_has_comments = context.get('site_has_comments', UNDEFINED)
  99. helper = _mako_get_namespace(context, 'helper')
  100. def content():
  101. return render_content(context)
  102. __M_writer = context.writer()
  103. __M_writer('\n')
  104. if 'parent' not in context._data or not hasattr(context._data['parent'], 'content_header'):
  105. context['self'].content_header(**pageargs)
  106. __M_writer('\n<div class="postindex">\n')
  107. for post in posts:
  108. __M_writer(' <article class="blog-post h-entry post-')
  109. __M_writer(str(post.meta('type')))
  110. __M_writer('">\n <header>\n <h2 class="p-name entry-title blog-post-title"><a href="')
  111. __M_writer(str(post.permalink()))
  112. __M_writer('" class="u-url">')
  113. __M_writer(filters.html_escape(str(post.title())))
  114. __M_writer('</a></h2>\n <div class="metadata blog-post-meta text-justify">\n <p class="byline author vcard"><span class="byline-name fn">')
  115. __M_writer(str(post.author()))
  116. __M_writer('</span></p>\n <p class="dateline"><a href="')
  117. __M_writer(str(post.permalink()))
  118. __M_writer('" rel="bookmark"><time class="published dt-published" datetime="')
  119. __M_writer(str(post.date.isoformat()))
  120. __M_writer('" title="')
  121. __M_writer(str(post.formatted_date(date_format)))
  122. __M_writer('">')
  123. __M_writer(str(post.formatted_date(date_format)))
  124. __M_writer('</time></a></p>\n')
  125. if not post.meta('nocomments') and site_has_comments:
  126. __M_writer(' <p class="commentline">')
  127. __M_writer(str(comments.comment_link(post.permalink(), post._base_path)))
  128. __M_writer('\n')
  129. __M_writer(' </div>\n </header>\n')
  130. if index_teasers:
  131. __M_writer(' <div class="p-summary entry-summary">\n ')
  132. __M_writer(str(post.text(teaser_only=True)))
  133. __M_writer('\n')
  134. else:
  135. __M_writer(' <div class="e-content entry-content">\n ')
  136. __M_writer(str(post.text(teaser_only=False)))
  137. __M_writer('\n')
  138. __M_writer(' </div>\n </article>\n')
  139. __M_writer('</div>\n')
  140. __M_writer(str(helper.html_pager()))
  141. __M_writer('\n')
  142. __M_writer(str(comments.comment_link_script()))
  143. __M_writer('\n')
  144. __M_writer(str(math.math_scripts_ifposts(posts)))
  145. __M_writer('\n')
  146. return ''
  147. finally:
  148. context.caller_stack._pop_frame()
  149. def render_content_header(context,**pageargs):
  150. __M_caller = context.caller_stack._push_frame()
  151. try:
  152. def content_header():
  153. return render_content_header(context)
  154. __M_writer = context.writer()
  155. return ''
  156. finally:
  157. context.caller_stack._pop_frame()
  158. """
  159. __M_BEGIN_METADATA
  160. {"filename": "themes/bootblog/templates/index.tmpl", "uri": "index.tmpl", "source_encoding": "utf-8", "line_map": {"23": 2, "26": 3, "29": 4, "35": 0, "56": 2, "57": 3, "58": 4, "59": 5, "64": 13, "69": 44, "75": 7, "86": 7, "87": 8, "88": 8, "89": 9, "90": 10, "91": 10, "92": 10, "93": 12, "94": 12, "95": 12, "101": 15, "116": 15, "121": 16, "122": 18, "123": 19, "124": 19, "125": 19, "126": 21, "127": 21, "128": 21, "129": 21, "130": 23, "131": 23, "132": 24, "133": 24, "134": 24, "135": 24, "136": 24, "137": 24, "138": 24, "139": 24, "140": 25, "141": 26, "142": 26, "143": 26, "144": 28, "145": 30, "146": 31, "147": 32, "148": 32, "149": 33, "150": 34, "151": 35, "152": 35, "153": 37, "154": 40, "155": 41, "156": 41, "157": 42, "158": 42, "159": 43, "160": 43, "166": 16, "177": 166}}
  161. __M_END_METADATA
  162. """