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

tag.tmpl.py 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.2723808
  9. _enable_loop = True
  10. _template_filename = '/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/tag.tmpl'
  11. _template_uri = 'tag.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['extra_head', 'content']
  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('feeds_translations', context._clean_inheritance_tokens(), templateuri='feeds_translations_helper.tmpl', callables=None, calling_uri=_template_uri)
  22. context.namespaces[(__name__, 'feeds_translations')] = ns
  23. def _mako_inherit(template, context):
  24. _mako_generate_namespaces(context)
  25. return runtime._inherit_from(context, 'list_post.tmpl', _template_uri)
  26. def render_body(context,**pageargs):
  27. __M_caller = context.caller_stack._push_frame()
  28. try:
  29. __M_locals = __M_dict_builtin(pageargs=pageargs)
  30. _import_ns = {}
  31. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  32. title = _import_ns.get('title', context.get('title', UNDEFINED))
  33. date_format = _import_ns.get('date_format', context.get('date_format', UNDEFINED))
  34. posts = _import_ns.get('posts', context.get('posts', UNDEFINED))
  35. def extra_head():
  36. return render_extra_head(context._locals(__M_locals))
  37. subcategories = _import_ns.get('subcategories', context.get('subcategories', UNDEFINED))
  38. def content():
  39. return render_content(context._locals(__M_locals))
  40. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  41. tag = _import_ns.get('tag', context.get('tag', UNDEFINED))
  42. description = _import_ns.get('description', context.get('description', UNDEFINED))
  43. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  44. kind = _import_ns.get('kind', context.get('kind', UNDEFINED))
  45. __M_writer = context.writer()
  46. __M_writer('\n')
  47. __M_writer('\n\n')
  48. if 'parent' not in context._data or not hasattr(context._data['parent'], 'extra_head'):
  49. context['self'].extra_head(**pageargs)
  50. __M_writer('\n\n')
  51. if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
  52. context['self'].content(**pageargs)
  53. __M_writer('\n')
  54. return ''
  55. finally:
  56. context.caller_stack._pop_frame()
  57. def render_extra_head(context,**pageargs):
  58. __M_caller = context.caller_stack._push_frame()
  59. try:
  60. _import_ns = {}
  61. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  62. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  63. tag = _import_ns.get('tag', context.get('tag', UNDEFINED))
  64. def extra_head():
  65. return render_extra_head(context)
  66. kind = _import_ns.get('kind', context.get('kind', UNDEFINED))
  67. __M_writer = context.writer()
  68. __M_writer('\n ')
  69. __M_writer(str(feeds_translations.head(tag, kind, rss_override=False)))
  70. __M_writer('\n')
  71. return ''
  72. finally:
  73. context.caller_stack._pop_frame()
  74. def render_content(context,**pageargs):
  75. __M_caller = context.caller_stack._push_frame()
  76. try:
  77. _import_ns = {}
  78. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  79. title = _import_ns.get('title', context.get('title', UNDEFINED))
  80. date_format = _import_ns.get('date_format', context.get('date_format', UNDEFINED))
  81. posts = _import_ns.get('posts', context.get('posts', UNDEFINED))
  82. subcategories = _import_ns.get('subcategories', context.get('subcategories', UNDEFINED))
  83. def content():
  84. return render_content(context)
  85. description = _import_ns.get('description', context.get('description', UNDEFINED))
  86. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  87. tag = _import_ns.get('tag', context.get('tag', UNDEFINED))
  88. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  89. kind = _import_ns.get('kind', context.get('kind', UNDEFINED))
  90. __M_writer = context.writer()
  91. __M_writer('\n<article class="tagpage">\n <header>\n <h1>')
  92. __M_writer(filters.html_escape(str(title)))
  93. __M_writer('</h1>\n')
  94. if description:
  95. __M_writer(' <p>')
  96. __M_writer(str(description))
  97. __M_writer('</p>\n')
  98. if subcategories:
  99. __M_writer(' ')
  100. __M_writer(str(messages('Subcategories:')))
  101. __M_writer('\n <ul>\n')
  102. for name, link in subcategories:
  103. __M_writer(' <li><a href="')
  104. __M_writer(str(link))
  105. __M_writer('">')
  106. __M_writer(filters.html_escape(str(name)))
  107. __M_writer('</a></li>\n')
  108. __M_writer(' </ul>\n')
  109. __M_writer(' <div class="metadata">\n ')
  110. __M_writer(str(feeds_translations.feed_link(tag, kind=kind)))
  111. __M_writer('\n </div>\n ')
  112. __M_writer(str(feeds_translations.translation_link(kind)))
  113. __M_writer('\n </header>\n')
  114. if posts:
  115. __M_writer(' <ul class="postlist">\n')
  116. for post in posts:
  117. __M_writer(' <li><time class="listdate" datetime="')
  118. __M_writer(str(post.formatted_date('webiso')))
  119. __M_writer('" title="')
  120. __M_writer(filters.html_escape(str(post.formatted_date(date_format))))
  121. __M_writer('">')
  122. __M_writer(filters.html_escape(str(post.formatted_date(date_format))))
  123. __M_writer('</time> <a href="')
  124. __M_writer(str(post.permalink()))
  125. __M_writer('" class="listtitle">')
  126. __M_writer(filters.html_escape(str(post.title())))
  127. __M_writer('<a></li>\n')
  128. __M_writer(' </ul>\n')
  129. __M_writer('</article>\n')
  130. return ''
  131. finally:
  132. context.caller_stack._pop_frame()
  133. """
  134. __M_BEGIN_METADATA
  135. {"filename": "/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/tag.tmpl", "uri": "tag.tmpl", "source_encoding": "utf-8", "line_map": {"23": 3, "29": 0, "49": 2, "50": 3, "55": 7, "60": 37, "66": 5, "77": 5, "78": 6, "79": 6, "85": 9, "102": 9, "103": 12, "104": 12, "105": 13, "106": 14, "107": 14, "108": 14, "109": 16, "110": 17, "111": 17, "112": 17, "113": 19, "114": 20, "115": 20, "116": 20, "117": 20, "118": 20, "119": 22, "120": 24, "121": 25, "122": 25, "123": 27, "124": 27, "125": 29, "126": 30, "127": 31, "128": 32, "129": 32, "130": 32, "131": 32, "132": 32, "133": 32, "134": 32, "135": 32, "136": 32, "137": 32, "138": 32, "139": 34, "140": 36, "146": 140}}
  136. __M_END_METADATA
  137. """