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

list_post.tmpl.py 6.6KB

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