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

post_header.tmpl.py 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.1002333
  9. _enable_loop = True
  10. _template_filename = 'themes/bootblog/templates/post_header.tmpl'
  11. _template_uri = 'post_header.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['html_title', 'html_translations', 'html_sourcelink', 'html_post_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='post_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. def render_body(context,**pageargs):
  26. __M_caller = context.caller_stack._push_frame()
  27. try:
  28. __M_locals = __M_dict_builtin(pageargs=pageargs)
  29. __M_writer = context.writer()
  30. __M_writer('\n')
  31. __M_writer('\n\n')
  32. __M_writer('\n\n')
  33. __M_writer('\n\n')
  34. __M_writer('\n\n')
  35. __M_writer('\n')
  36. return ''
  37. finally:
  38. context.caller_stack._pop_frame()
  39. def render_html_title(context):
  40. __M_caller = context.caller_stack._push_frame()
  41. try:
  42. post = context.get('post', UNDEFINED)
  43. title = context.get('title', UNDEFINED)
  44. __M_writer = context.writer()
  45. __M_writer('\n')
  46. if title and not post.meta('hidetitle'):
  47. __M_writer(' <h2 class="p-name entry-title blog-post-title" itemprop="headline name"><a href="')
  48. __M_writer(str(post.permalink()))
  49. __M_writer('" class="u-url">')
  50. __M_writer(filters.html_escape(str(post.title())))
  51. __M_writer('</a></h2>\n')
  52. return ''
  53. finally:
  54. context.caller_stack._pop_frame()
  55. def render_html_translations(context,post):
  56. __M_caller = context.caller_stack._push_frame()
  57. try:
  58. messages = context.get('messages', UNDEFINED)
  59. lang = context.get('lang', UNDEFINED)
  60. len = context.get('len', UNDEFINED)
  61. translations = context.get('translations', UNDEFINED)
  62. __M_writer = context.writer()
  63. __M_writer('\n')
  64. if len(post.translated_to) > 1:
  65. __M_writer(' <div class="metadata posttranslations translations">\n <h3 class="posttranslations-intro">')
  66. __M_writer(str(messages("Also available in:")))
  67. __M_writer('</h3>\n')
  68. for langname in translations.keys():
  69. if langname != lang and post.is_translation_available(langname):
  70. __M_writer(' <p><a href="')
  71. __M_writer(str(post.permalink(langname)))
  72. __M_writer('" rel="alternate" hreflang="')
  73. __M_writer(str(langname))
  74. __M_writer('">')
  75. __M_writer(str(messages("LANGUAGE", langname)))
  76. __M_writer('</a></p>\n')
  77. __M_writer(' </div>\n')
  78. return ''
  79. finally:
  80. context.caller_stack._pop_frame()
  81. def render_html_sourcelink(context):
  82. __M_caller = context.caller_stack._push_frame()
  83. try:
  84. post = context.get('post', UNDEFINED)
  85. show_sourcelink = context.get('show_sourcelink', UNDEFINED)
  86. messages = context.get('messages', UNDEFINED)
  87. __M_writer = context.writer()
  88. __M_writer('\n')
  89. if show_sourcelink:
  90. __M_writer(' <p class="sourceline"><a href="')
  91. __M_writer(str(post.source_link()))
  92. __M_writer('" id="sourcelink">')
  93. __M_writer(str(messages("Source")))
  94. __M_writer('</a></p>\n')
  95. return ''
  96. finally:
  97. context.caller_stack._pop_frame()
  98. def render_html_post_header(context):
  99. __M_caller = context.caller_stack._push_frame()
  100. try:
  101. date_format = context.get('date_format', UNDEFINED)
  102. def html_title():
  103. return render_html_title(context)
  104. comments = _mako_get_namespace(context, 'comments')
  105. post = context.get('post', UNDEFINED)
  106. def html_sourcelink():
  107. return render_html_sourcelink(context)
  108. site_has_comments = context.get('site_has_comments', UNDEFINED)
  109. messages = context.get('messages', UNDEFINED)
  110. def html_translations(post):
  111. return render_html_translations(context,post)
  112. __M_writer = context.writer()
  113. __M_writer('\n <header>\n ')
  114. __M_writer(str(html_title()))
  115. __M_writer('\n <div class="metadata blog-post-meta">\n <p class="byline author vcard"><span class="byline-name fn">')
  116. __M_writer(str(post.author()))
  117. __M_writer('</span></p>\n <p class="dateline"><a href="')
  118. __M_writer(str(post.permalink()))
  119. __M_writer('" rel="bookmark"><time class="published dt-published" datetime="')
  120. __M_writer(str(post.date.isoformat()))
  121. __M_writer('" itemprop="datePublished" title="')
  122. __M_writer(str(post.formatted_date(date_format)))
  123. __M_writer('">')
  124. __M_writer(str(post.formatted_date(date_format)))
  125. __M_writer('</time></a></p>\n')
  126. if not post.meta('nocomments') and site_has_comments:
  127. __M_writer(' <p class="commentline">')
  128. __M_writer(str(comments.comment_link(post.permalink(), post._base_path)))
  129. __M_writer('\n')
  130. __M_writer(' ')
  131. __M_writer(str(html_sourcelink()))
  132. __M_writer('\n')
  133. if post.meta('link'):
  134. __M_writer(' <p class="linkline"><a href=\'')
  135. __M_writer(str(post.meta('link')))
  136. __M_writer("'>")
  137. __M_writer(str(messages("Original site")))
  138. __M_writer('</a></p>\n')
  139. if post.description():
  140. __M_writer(' <meta name="description" itemprop="description" content="')
  141. __M_writer(str(post.description()))
  142. __M_writer('">\n')
  143. __M_writer(' </div>\n ')
  144. __M_writer(str(html_translations(post)))
  145. __M_writer('\n </header>\n')
  146. return ''
  147. finally:
  148. context.caller_stack._pop_frame()
  149. """
  150. __M_BEGIN_METADATA
  151. {"filename": "themes/bootblog/templates/post_header.tmpl", "uri": "post_header.tmpl", "source_encoding": "utf-8", "line_map": {"23": 2, "26": 3, "29": 0, "34": 2, "35": 3, "36": 9, "37": 22, "38": 28, "39": 49, "45": 5, "51": 5, "52": 6, "53": 7, "54": 7, "55": 7, "56": 7, "57": 7, "63": 11, "71": 11, "72": 12, "73": 13, "74": 14, "75": 14, "76": 15, "77": 16, "78": 17, "79": 17, "80": 17, "81": 17, "82": 17, "83": 17, "84": 17, "85": 20, "91": 24, "98": 24, "99": 25, "100": 26, "101": 26, "102": 26, "103": 26, "104": 26, "110": 30, "125": 30, "126": 32, "127": 32, "128": 34, "129": 34, "130": 35, "131": 35, "132": 35, "133": 35, "134": 35, "135": 35, "136": 35, "137": 35, "138": 36, "139": 37, "140": 37, "141": 37, "142": 39, "143": 39, "144": 39, "145": 40, "146": 41, "147": 41, "148": 41, "149": 41, "150": 41, "151": 43, "152": 44, "153": 44, "154": 44, "155": 46, "156": 47, "157": 47, "163": 157}}
  152. __M_END_METADATA
  153. """