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

base_helper.tmpl.py 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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.1938248
  9. _enable_loop = True
  10. _template_filename = 'themes/bootblog/templates/base_helper.tmpl'
  11. _template_uri = 'base_helper.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['html_headstart', 'late_load_js', 'html_stylesheets', 'html_navigation_links', 'html_feedlinks', 'html_translations']
  14. def render_body(context,**pageargs):
  15. __M_caller = context.caller_stack._push_frame()
  16. try:
  17. __M_locals = __M_dict_builtin(pageargs=pageargs)
  18. __M_writer = context.writer()
  19. __M_writer('\n')
  20. __M_writer('\n\n')
  21. __M_writer('\n\n\n')
  22. __M_writer('\n\n')
  23. __M_writer('\n\n')
  24. __M_writer('\n\n')
  25. __M_writer('\n\n\n')
  26. return ''
  27. finally:
  28. context.caller_stack._pop_frame()
  29. def render_html_headstart(context):
  30. __M_caller = context.caller_stack._push_frame()
  31. try:
  32. url_replacer = context.get('url_replacer', UNDEFINED)
  33. striphtml = context.get('striphtml', UNDEFINED)
  34. abs_link = context.get('abs_link', UNDEFINED)
  35. lang = context.get('lang', UNDEFINED)
  36. use_cdn = context.get('use_cdn', UNDEFINED)
  37. twitter_card = context.get('twitter_card', UNDEFINED)
  38. favicons = context.get('favicons', UNDEFINED)
  39. comment_system_id = context.get('comment_system_id', UNDEFINED)
  40. title = context.get('title', UNDEFINED)
  41. permalink = context.get('permalink', UNDEFINED)
  42. blog_title = context.get('blog_title', UNDEFINED)
  43. def html_stylesheets():
  44. return render_html_stylesheets(context)
  45. use_open_graph = context.get('use_open_graph', UNDEFINED)
  46. description = context.get('description', UNDEFINED)
  47. prevlink = context.get('prevlink', UNDEFINED)
  48. def html_feedlinks():
  49. return render_html_feedlinks(context)
  50. nextlink = context.get('nextlink', UNDEFINED)
  51. comment_system = context.get('comment_system', UNDEFINED)
  52. is_rtl = context.get('is_rtl', UNDEFINED)
  53. extra_head_data = context.get('extra_head_data', UNDEFINED)
  54. __M_writer = context.writer()
  55. __M_writer('\n<!DOCTYPE html>\n<html\n')
  56. if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook'):
  57. __M_writer("prefix='")
  58. if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
  59. __M_writer('og: http://ogp.me/ns# ')
  60. if use_open_graph:
  61. __M_writer('article: http://ogp.me/ns/article# ')
  62. if comment_system == 'facebook':
  63. __M_writer('fb: http://ogp.me/ns/fb# ')
  64. __M_writer("'")
  65. if is_rtl:
  66. __M_writer('dir="rtl" ')
  67. __M_writer('lang="')
  68. __M_writer(str(lang))
  69. __M_writer('">\n <head>\n <meta charset="utf-8">\n')
  70. if description:
  71. __M_writer(' <meta name="description" content="')
  72. __M_writer(str(description))
  73. __M_writer('">\n')
  74. __M_writer(' <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>')
  75. __M_writer(striphtml(str(title)))
  76. __M_writer(' | ')
  77. __M_writer(striphtml(str(blog_title)))
  78. __M_writer('</title>\n\n\n\n ')
  79. __M_writer(str(html_stylesheets()))
  80. __M_writer('\n ')
  81. __M_writer(str(html_feedlinks()))
  82. __M_writer('\n')
  83. if permalink:
  84. __M_writer(' <link rel="canonical" href="')
  85. __M_writer(str(abs_link(permalink)))
  86. __M_writer('">\n')
  87. __M_writer('\n')
  88. if favicons:
  89. for name, file, size in favicons:
  90. __M_writer(' <link rel="')
  91. __M_writer(str(name))
  92. __M_writer('" href="')
  93. __M_writer(str(file))
  94. __M_writer('" sizes="')
  95. __M_writer(str(size))
  96. __M_writer('"/>\n')
  97. __M_writer('\n')
  98. if comment_system == 'facebook':
  99. __M_writer(' <meta property="fb:app_id" content="')
  100. __M_writer(str(comment_system_id))
  101. __M_writer('">\n')
  102. __M_writer('\n')
  103. if prevlink:
  104. __M_writer(' <link rel="prev" href="')
  105. __M_writer(str(prevlink))
  106. __M_writer('" type="text/html">\n')
  107. if nextlink:
  108. __M_writer(' <link rel="next" href="')
  109. __M_writer(str(nextlink))
  110. __M_writer('" type="text/html">\n')
  111. __M_writer('\n')
  112. if use_cdn:
  113. __M_writer(' <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->\n')
  114. else:
  115. __M_writer(' <!--[if lt IE 9]><script src="')
  116. __M_writer(str(url_replacer(permalink, '/assets/js/html5.js', lang)))
  117. __M_writer('"></script><![endif]-->\n')
  118. __M_writer('\n ')
  119. __M_writer(str(extra_head_data))
  120. __M_writer('\n')
  121. return ''
  122. finally:
  123. context.caller_stack._pop_frame()
  124. def render_late_load_js(context):
  125. __M_caller = context.caller_stack._push_frame()
  126. try:
  127. use_cdn = context.get('use_cdn', UNDEFINED)
  128. social_buttons_code = context.get('social_buttons_code', UNDEFINED)
  129. use_bundles = context.get('use_bundles', UNDEFINED)
  130. __M_writer = context.writer()
  131. __M_writer('\n')
  132. if use_bundles:
  133. if use_cdn:
  134. __M_writer(' <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>\n <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>\n <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.js" integrity="sha256-SoEATAB7PgNWyyK100I7yQXYm5V08k5SFupDP0h72MY=" crossorigin="anonymous"></script>\n <script src="/assets/js/all.js"></script>\n')
  135. else:
  136. __M_writer(' <script src="/assets/js/all-nocdn.js"></script>\n')
  137. else:
  138. if use_cdn:
  139. __M_writer(' <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>\n <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>\n')
  140. else:
  141. __M_writer(' <script src="/assets/js/jquery.min.js"></script>\n <script src="/assets/js/bootstrap.min.js"></script>\n <script src="/assets/js/baguetteBox.min.js"></script>\n')
  142. __M_writer(' <script src="/assets/js/moment-with-locales.min.js"></script>\n <script src="/assets/js/fancydates.min.js"></script>\t\n')
  143. __M_writer(' ')
  144. __M_writer(str(social_buttons_code))
  145. __M_writer('\n')
  146. return ''
  147. finally:
  148. context.caller_stack._pop_frame()
  149. def render_html_stylesheets(context):
  150. __M_caller = context.caller_stack._push_frame()
  151. try:
  152. needs_ipython_css = context.get('needs_ipython_css', UNDEFINED)
  153. use_cdn = context.get('use_cdn', UNDEFINED)
  154. has_custom_css = context.get('has_custom_css', UNDEFINED)
  155. use_bundles = context.get('use_bundles', UNDEFINED)
  156. __M_writer = context.writer()
  157. __M_writer('\n')
  158. if use_bundles:
  159. if use_cdn:
  160. __M_writer(' <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />\n <link href="/assets/css/all.css" rel="stylesheet" type="text/css">\n')
  161. else:
  162. __M_writer(' <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">\n')
  163. else:
  164. if use_cdn:
  165. __M_writer(' <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />\n')
  166. else:
  167. __M_writer(' <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/baguetteBox.min.css" rel="stylesheet" type="text/css">\n')
  168. __M_writer(' <link href="/assets/css/rst.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/code.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/theme.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/blog.css" rel="stylesheet" type="text/css">\n')
  169. if has_custom_css:
  170. __M_writer(' <link href="/assets/css/custom.css" rel="stylesheet" type="text/css">\n')
  171. if needs_ipython_css:
  172. __M_writer(' <link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css">\n <link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">\n')
  173. return ''
  174. finally:
  175. context.caller_stack._pop_frame()
  176. def render_html_navigation_links(context):
  177. __M_caller = context.caller_stack._push_frame()
  178. try:
  179. permalink = context.get('permalink', UNDEFINED)
  180. rel_link = context.get('rel_link', UNDEFINED)
  181. lang = context.get('lang', UNDEFINED)
  182. navigation_links = context.get('navigation_links', UNDEFINED)
  183. messages = context.get('messages', UNDEFINED)
  184. __M_writer = context.writer()
  185. __M_writer('\n')
  186. for url, text in navigation_links[lang]:
  187. if rel_link(permalink, url) == "#":
  188. __M_writer(' <a href="')
  189. __M_writer(str(permalink))
  190. __M_writer('" class="blog-nav-item active">')
  191. __M_writer(str(text))
  192. __M_writer(' <span class="sr-only">')
  193. __M_writer(str(messages("(active)", lang)))
  194. __M_writer('</span></a>\n')
  195. else:
  196. __M_writer(' <a href="')
  197. __M_writer(str(url))
  198. __M_writer('" class="blog-nav-item">')
  199. __M_writer(str(text))
  200. __M_writer('</a>\n')
  201. return ''
  202. finally:
  203. context.caller_stack._pop_frame()
  204. def render_html_feedlinks(context):
  205. __M_caller = context.caller_stack._push_frame()
  206. try:
  207. len = context.get('len', UNDEFINED)
  208. generate_atom = context.get('generate_atom', UNDEFINED)
  209. _link = context.get('_link', UNDEFINED)
  210. rss_link = context.get('rss_link', UNDEFINED)
  211. translations = context.get('translations', UNDEFINED)
  212. generate_rss = context.get('generate_rss', UNDEFINED)
  213. __M_writer = context.writer()
  214. __M_writer('\n')
  215. if rss_link:
  216. __M_writer(' ')
  217. __M_writer(str(rss_link))
  218. __M_writer('\n')
  219. elif generate_rss:
  220. if len(translations) > 1:
  221. for language in translations:
  222. __M_writer(' <link rel="alternate" type="application/rss+xml" title="RSS (')
  223. __M_writer(str(language))
  224. __M_writer(')" href="')
  225. __M_writer(str(_link('rss', None, language)))
  226. __M_writer('">\n')
  227. else:
  228. __M_writer(' <link rel="alternate" type="application/rss+xml" title="RSS" href="')
  229. __M_writer(str(_link('rss', None)))
  230. __M_writer('">\n')
  231. if generate_atom:
  232. if len(translations) > 1:
  233. for language in translations:
  234. __M_writer(' <link rel="alternate" type="application/atom+xml" title="Atom (')
  235. __M_writer(str(language))
  236. __M_writer(')" href="')
  237. __M_writer(str(_link('index_atom', None, language)))
  238. __M_writer('">\n')
  239. else:
  240. __M_writer(' <link rel="alternate" type="application/atom+xml" title="Atom" href="')
  241. __M_writer(str(_link('index_atom', None)))
  242. __M_writer('">\n')
  243. return ''
  244. finally:
  245. context.caller_stack._pop_frame()
  246. def render_html_translations(context):
  247. __M_caller = context.caller_stack._push_frame()
  248. try:
  249. abs_link = context.get('abs_link', UNDEFINED)
  250. lang = context.get('lang', UNDEFINED)
  251. _link = context.get('_link', UNDEFINED)
  252. messages = context.get('messages', UNDEFINED)
  253. translations = context.get('translations', UNDEFINED)
  254. __M_writer = context.writer()
  255. __M_writer('\n')
  256. for langname in translations.keys():
  257. if langname != lang:
  258. __M_writer(' <a class="blog-nav-item blog-nav-item-aside" href="')
  259. __M_writer(str(abs_link(_link("root", None, langname))))
  260. __M_writer('" rel="alternate" hreflang="')
  261. __M_writer(str(langname))
  262. __M_writer('">')
  263. __M_writer(str(messages("LANGUAGE", langname)))
  264. __M_writer('</a>\n')
  265. return ''
  266. finally:
  267. context.caller_stack._pop_frame()
  268. """
  269. __M_BEGIN_METADATA
  270. {"filename": "themes/bootblog/templates/base_helper.tmpl", "uri": "base_helper.tmpl", "source_encoding": "utf-8", "line_map": {"16": 0, "21": 2, "22": 66, "23": 91, "24": 123, "25": 133, "26": 156, "27": 164, "33": 3, "59": 3, "60": 7, "61": 8, "62": 9, "63": 10, "64": 12, "65": 13, "66": 15, "67": 16, "68": 18, "69": 21, "70": 22, "71": 25, "72": 25, "73": 25, "74": 28, "75": 29, "76": 29, "77": 29, "78": 31, "79": 32, "80": 32, "81": 32, "82": 32, "83": 36, "84": 36, "85": 37, "86": 37, "87": 38, "88": 39, "89": 39, "90": 39, "91": 41, "92": 42, "93": 43, "94": 44, "95": 44, "96": 44, "97": 44, "98": 44, "99": 44, "100": 44, "101": 47, "102": 48, "103": 49, "104": 49, "105": 49, "106": 51, "107": 52, "108": 53, "109": 53, "110": 53, "111": 55, "112": 56, "113": 56, "114": 56, "115": 58, "116": 59, "117": 60, "118": 61, "119": 62, "120": 62, "121": 62, "122": 64, "123": 65, "124": 65, "130": 68, "137": 68, "138": 69, "139": 70, "140": 71, "141": 75, "142": 76, "143": 78, "144": 79, "145": 80, "146": 82, "147": 83, "148": 87, "149": 90, "150": 90, "151": 90, "157": 94, "165": 94, "166": 95, "167": 96, "168": 97, "169": 100, "170": 101, "171": 103, "172": 104, "173": 105, "174": 107, "175": 108, "176": 111, "177": 115, "178": 116, "179": 119, "180": 120, "186": 125, "195": 125, "196": 126, "197": 127, "198": 128, "199": 128, "200": 128, "201": 128, "202": 128, "203": 128, "204": 128, "205": 129, "206": 130, "207": 130, "208": 130, "209": 130, "210": 130, "216": 135, "226": 135, "227": 136, "228": 137, "229": 137, "230": 137, "231": 138, "232": 139, "233": 140, "234": 141, "235": 141, "236": 141, "237": 141, "238": 141, "239": 143, "240": 144, "241": 144, "242": 144, "243": 147, "244": 148, "245": 149, "246": 150, "247": 150, "248": 150, "249": 150, "250": 150, "251": 152, "252": 153, "253": 153, "254": 153, "260": 158, "269": 158, "270": 159, "271": 160, "272": 161, "273": 161, "274": 161, "275": 161, "276": 161, "277": 161, "278": 161, "284": 278}}
  271. __M_END_METADATA
  272. """