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

story.tmpl.py 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.0727968
  9. _enable_loop = True
  10. _template_filename = '/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/story.tmpl'
  11. _template_uri = 'story.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['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('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('pheader', context._clean_inheritance_tokens(), templateuri='post_header.tmpl', callables=None, calling_uri=_template_uri)
  24. context.namespaces[(__name__, 'pheader')] = ns
  25. ns = runtime.TemplateNamespace('comments', context._clean_inheritance_tokens(), templateuri='comments_helper.tmpl', callables=None, calling_uri=_template_uri)
  26. context.namespaces[(__name__, 'comments')] = ns
  27. ns = runtime.TemplateNamespace('math', context._clean_inheritance_tokens(), templateuri='math_helper.tmpl', callables=None, calling_uri=_template_uri)
  28. context.namespaces[(__name__, 'math')] = ns
  29. def _mako_inherit(template, context):
  30. _mako_generate_namespaces(context)
  31. return runtime._inherit_from(context, 'post.tmpl', _template_uri)
  32. def render_body(context,**pageargs):
  33. __M_caller = context.caller_stack._push_frame()
  34. try:
  35. __M_locals = __M_dict_builtin(pageargs=pageargs)
  36. math = _mako_get_namespace(context, 'math')
  37. enable_comments = context.get('enable_comments', UNDEFINED)
  38. messages = context.get('messages', UNDEFINED)
  39. comments = _mako_get_namespace(context, 'comments')
  40. post = context.get('post', UNDEFINED)
  41. site_has_comments = context.get('site_has_comments', UNDEFINED)
  42. pheader = _mako_get_namespace(context, 'pheader')
  43. def content():
  44. return render_content(context._locals(__M_locals))
  45. __M_writer = context.writer()
  46. __M_writer('\n')
  47. __M_writer('\n')
  48. __M_writer('\n')
  49. __M_writer('\n')
  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_content(context,**pageargs):
  58. __M_caller = context.caller_stack._push_frame()
  59. try:
  60. math = _mako_get_namespace(context, 'math')
  61. enable_comments = context.get('enable_comments', UNDEFINED)
  62. messages = context.get('messages', UNDEFINED)
  63. comments = _mako_get_namespace(context, 'comments')
  64. post = context.get('post', UNDEFINED)
  65. site_has_comments = context.get('site_has_comments', UNDEFINED)
  66. pheader = _mako_get_namespace(context, 'pheader')
  67. def content():
  68. return render_content(context)
  69. __M_writer = context.writer()
  70. __M_writer('\n<article class="post-')
  71. __M_writer(str(post.meta('type')))
  72. __M_writer(' storypage" itemscope="itemscope" itemtype="http://schema.org/Article">\n <header>\n ')
  73. __M_writer(str(pheader.html_title()))
  74. __M_writer('\n ')
  75. __M_writer(str(pheader.html_translations(post)))
  76. __M_writer('\n </header>\n <div class="e-content entry-content" itemprop="articleBody text">\n ')
  77. __M_writer(str(post.text()))
  78. __M_writer('\n </div>\n')
  79. if site_has_comments and enable_comments and not post.meta('nocomments'):
  80. __M_writer(' <section class="comments">\n <h2>')
  81. __M_writer(str(messages("Comments")))
  82. __M_writer('</h2>\n ')
  83. __M_writer(str(comments.comment_form(post.permalink(absolute=True), post.title(), post.base_path)))
  84. __M_writer('\n </section>\n')
  85. __M_writer(' ')
  86. __M_writer(str(math.math_scripts_ifpost(post)))
  87. __M_writer('\n</article>\n')
  88. return ''
  89. finally:
  90. context.caller_stack._pop_frame()
  91. """
  92. __M_BEGIN_METADATA
  93. {"filename": "/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/story.tmpl", "uri": "story.tmpl", "source_encoding": "utf-8", "line_map": {"23": 2, "26": 3, "29": 4, "32": 5, "38": 0, "52": 2, "53": 3, "54": 4, "55": 5, "56": 6, "61": 25, "67": 8, "80": 8, "81": 9, "82": 9, "83": 11, "84": 11, "85": 12, "86": 12, "87": 15, "88": 15, "89": 17, "90": 18, "91": 19, "92": 19, "93": 20, "94": 20, "95": 23, "96": 23, "97": 23, "103": 97}}
  94. __M_END_METADATA
  95. """