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

feeds_translations_helper.tmpl.py 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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.301689
  9. _enable_loop = True
  10. _template_filename = '/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/feeds_translations_helper.tmpl'
  11. _template_uri = 'feeds_translations_helper.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['_head_feed_link', '_html_feed_link', '_html_translation_link', '_head_rss', '_head_atom', 'head', 'feed_link', 'translation_link']
  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')
  22. __M_writer('\n\n')
  23. __M_writer('\n\n')
  24. __M_writer('\n\n')
  25. __M_writer('\n\n')
  26. __M_writer('\n\n')
  27. __M_writer('\n')
  28. return ''
  29. finally:
  30. context.caller_stack._pop_frame()
  31. def render__head_feed_link(context,link_type,link_name,link_postfix,classification,kind,language):
  32. __M_caller = context.caller_stack._push_frame()
  33. try:
  34. translations = context.get('translations', UNDEFINED)
  35. len = context.get('len', UNDEFINED)
  36. _link = context.get('_link', UNDEFINED)
  37. __M_writer = context.writer()
  38. __M_writer('\n')
  39. if len(translations) > 1:
  40. __M_writer(' <link rel="alternate" type="')
  41. __M_writer(str(link_type))
  42. __M_writer('" title="')
  43. __M_writer(filters.html_escape(str(link_name)))
  44. __M_writer(' (')
  45. __M_writer(str(language))
  46. __M_writer(')" hreflang="')
  47. __M_writer(str(language))
  48. __M_writer('" href="')
  49. __M_writer(str(_link(kind + '_' + link_postfix, classification, language)))
  50. __M_writer('">\n')
  51. else:
  52. __M_writer(' <link rel="alternate" type="')
  53. __M_writer(str(link_type))
  54. __M_writer('" title="')
  55. __M_writer(filters.html_escape(str(link_name)))
  56. __M_writer('" hreflang="')
  57. __M_writer(str(language))
  58. __M_writer('" href="')
  59. __M_writer(str(_link(kind + '_' + link_postfix, classification, language)))
  60. __M_writer('">\n')
  61. return ''
  62. finally:
  63. context.caller_stack._pop_frame()
  64. def render__html_feed_link(context,link_type,link_name,link_postfix,classification,kind,language,name=None):
  65. __M_caller = context.caller_stack._push_frame()
  66. try:
  67. messages = context.get('messages', UNDEFINED)
  68. translations = context.get('translations', UNDEFINED)
  69. len = context.get('len', UNDEFINED)
  70. _link = context.get('_link', UNDEFINED)
  71. __M_writer = context.writer()
  72. __M_writer('\n')
  73. if len(translations) > 1:
  74. if name and kind != "archive" and kind != "author":
  75. __M_writer(' <a href="')
  76. __M_writer(str(_link(kind + '_' + link_postfix, classification, language)))
  77. __M_writer('" hreflang="')
  78. __M_writer(str(language))
  79. __M_writer('" type="')
  80. __M_writer(str(link_type))
  81. __M_writer('">')
  82. __M_writer(str(messages(link_name, language)))
  83. __M_writer(' (')
  84. __M_writer(filters.html_escape(str(name)))
  85. __M_writer(', ')
  86. __M_writer(str(language))
  87. __M_writer(')</a>\n')
  88. else:
  89. __M_writer(' <a href="')
  90. __M_writer(str(_link(kind + '_' + link_postfix, classification, language)))
  91. __M_writer('" hreflang="')
  92. __M_writer(str(language))
  93. __M_writer('" type="')
  94. __M_writer(str(link_type))
  95. __M_writer('">')
  96. __M_writer(str(messages(link_name, language)))
  97. __M_writer(' (')
  98. __M_writer(str(language))
  99. __M_writer(')</a>\n')
  100. else:
  101. if name and kind != "archive" and kind != "author":
  102. __M_writer(' <a href="')
  103. __M_writer(str(_link(kind + '_' + link_postfix, classification, language)))
  104. __M_writer('" hreflang="')
  105. __M_writer(str(language))
  106. __M_writer('" type="')
  107. __M_writer(str(link_type))
  108. __M_writer('">')
  109. __M_writer(str(messages(link_name, language)))
  110. __M_writer(' (')
  111. __M_writer(filters.html_escape(str(name)))
  112. __M_writer(')</a>\n')
  113. else:
  114. __M_writer(' <a href="')
  115. __M_writer(str(_link(kind + '_' + link_postfix, classification, language)))
  116. __M_writer('" hreflang="')
  117. __M_writer(str(language))
  118. __M_writer('" type="')
  119. __M_writer(str(link_type))
  120. __M_writer('">')
  121. __M_writer(str(messages(link_name, language)))
  122. __M_writer('</a>\n')
  123. return ''
  124. finally:
  125. context.caller_stack._pop_frame()
  126. def render__html_translation_link(context,classification,kind,language,name=None):
  127. __M_caller = context.caller_stack._push_frame()
  128. try:
  129. messages = context.get('messages', UNDEFINED)
  130. _link = context.get('_link', UNDEFINED)
  131. __M_writer = context.writer()
  132. __M_writer('\n')
  133. if name and kind != "archive" and kind != "author":
  134. __M_writer(' <a href="')
  135. __M_writer(str(_link(kind, classification, language)))
  136. __M_writer('" hreflang="')
  137. __M_writer(str(language))
  138. __M_writer('" rel="alternate">')
  139. __M_writer(str(messages("LANGUAGE", language)))
  140. __M_writer(' (')
  141. __M_writer(filters.html_escape(str(name)))
  142. __M_writer(')</a>\n')
  143. else:
  144. __M_writer(' <a href="')
  145. __M_writer(str(_link(kind, classification, language)))
  146. __M_writer('" hreflang="')
  147. __M_writer(str(language))
  148. __M_writer('" rel="alternate">')
  149. __M_writer(str(messages("LANGUAGE", language)))
  150. __M_writer('</a>\n')
  151. return ''
  152. finally:
  153. context.caller_stack._pop_frame()
  154. def render__head_rss(context,classification=None,kind='index',rss_override=True):
  155. __M_caller = context.caller_stack._push_frame()
  156. try:
  157. len = context.get('len', UNDEFINED)
  158. has_other_languages = context.get('has_other_languages', UNDEFINED)
  159. all_languages = context.get('all_languages', UNDEFINED)
  160. translations_feedorder = context.get('translations_feedorder', UNDEFINED)
  161. _link = context.get('_link', UNDEFINED)
  162. rss_link = context.get('rss_link', UNDEFINED)
  163. translations = context.get('translations', UNDEFINED)
  164. generate_rss = context.get('generate_rss', UNDEFINED)
  165. def _head_feed_link(link_type,link_name,link_postfix,classification,kind,language):
  166. return render__head_feed_link(context,link_type,link_name,link_postfix,classification,kind,language)
  167. __M_writer = context.writer()
  168. __M_writer('\n')
  169. if rss_link and rss_override:
  170. __M_writer(' ')
  171. __M_writer(str(rss_link))
  172. __M_writer('\n')
  173. if generate_rss and not (rss_link and rss_override) and kind != 'archive':
  174. if len(translations) > 1 and has_other_languages and classification and kind != 'index':
  175. for language, classification, name in all_languages:
  176. __M_writer(' <link rel="alternate" type="application/rss+xml" title="RSS for ')
  177. __M_writer(str(kind))
  178. __M_writer(' ')
  179. __M_writer(filters.html_escape(str(name)))
  180. __M_writer(' (')
  181. __M_writer(str(language))
  182. __M_writer(')" hreflang="')
  183. __M_writer(str(language))
  184. __M_writer('" href="')
  185. __M_writer(str(_link(kind + "_rss", classification, language)))
  186. __M_writer('">\n')
  187. else:
  188. for language in translations_feedorder:
  189. if (classification or classification == '') and kind != 'index':
  190. __M_writer(' ')
  191. __M_writer(str(_head_feed_link('application/rss+xml', 'RSS for ' + kind + ' ' + classification, 'rss', classification, kind, language)))
  192. __M_writer('\n')
  193. else:
  194. __M_writer(' ')
  195. __M_writer(str(_head_feed_link('application/rss+xml', 'RSS', 'rss', classification, 'index', language)))
  196. __M_writer('\n')
  197. return ''
  198. finally:
  199. context.caller_stack._pop_frame()
  200. def render__head_atom(context,classification=None,kind='index'):
  201. __M_caller = context.caller_stack._push_frame()
  202. try:
  203. len = context.get('len', UNDEFINED)
  204. has_other_languages = context.get('has_other_languages', UNDEFINED)
  205. all_languages = context.get('all_languages', UNDEFINED)
  206. generate_atom = context.get('generate_atom', UNDEFINED)
  207. translations_feedorder = context.get('translations_feedorder', UNDEFINED)
  208. _link = context.get('_link', UNDEFINED)
  209. translations = context.get('translations', UNDEFINED)
  210. def _head_feed_link(link_type,link_name,link_postfix,classification,kind,language):
  211. return render__head_feed_link(context,link_type,link_name,link_postfix,classification,kind,language)
  212. __M_writer = context.writer()
  213. __M_writer('\n')
  214. if generate_atom:
  215. if len(translations) > 1 and has_other_languages and classification and kind != 'index':
  216. for language, classification, name in all_languages:
  217. __M_writer(' <link rel="alternate" type="application/atom+xml" title="Atom for ')
  218. __M_writer(str(kind))
  219. __M_writer(' ')
  220. __M_writer(filters.html_escape(str(name)))
  221. __M_writer(' (')
  222. __M_writer(str(language))
  223. __M_writer(')" hreflang="')
  224. __M_writer(str(language))
  225. __M_writer('" href="')
  226. __M_writer(str(_link(kind + "_atom", classification, language)))
  227. __M_writer('">\n')
  228. else:
  229. for language in translations_feedorder:
  230. if (classification or classification == '') and kind != 'index':
  231. __M_writer(' ')
  232. __M_writer(str(_head_feed_link('application/atom+xml', 'Atom for ' + kind + ' ' + classification, 'atom', classification, kind, language)))
  233. __M_writer('\n')
  234. else:
  235. __M_writer(' ')
  236. __M_writer(str(_head_feed_link('application/atom+xml', 'Atom', 'atom', classification, 'index', language)))
  237. __M_writer('\n')
  238. return ''
  239. finally:
  240. context.caller_stack._pop_frame()
  241. def render_head(context,classification=None,kind='index',feeds=True,other=True,rss_override=True,has_no_feeds=False):
  242. __M_caller = context.caller_stack._push_frame()
  243. try:
  244. has_other_languages = context.get('has_other_languages', UNDEFINED)
  245. _link = context.get('_link', UNDEFINED)
  246. def _head_atom(classification=None,kind='index'):
  247. return render__head_atom(context,classification,kind)
  248. def _head_rss(classification=None,kind='index',rss_override=True):
  249. return render__head_rss(context,classification,kind,rss_override)
  250. other_languages = context.get('other_languages', UNDEFINED)
  251. __M_writer = context.writer()
  252. __M_writer('\n')
  253. if feeds and not has_no_feeds:
  254. __M_writer(' ')
  255. __M_writer(str(_head_rss(classification, 'index' if (kind == 'archive' and rss_override) else kind, rss_override)))
  256. __M_writer('\n ')
  257. __M_writer(str(_head_atom(classification, kind)))
  258. __M_writer('\n')
  259. if other and has_other_languages and other_languages:
  260. for language, classification, _ in other_languages:
  261. __M_writer(' <link rel="alternate" hreflang="')
  262. __M_writer(str(language))
  263. __M_writer('" href="')
  264. __M_writer(str(_link(kind, classification, language)))
  265. __M_writer('">\n')
  266. return ''
  267. finally:
  268. context.caller_stack._pop_frame()
  269. def render_feed_link(context,classification,kind):
  270. __M_caller = context.caller_stack._push_frame()
  271. try:
  272. len = context.get('len', UNDEFINED)
  273. has_other_languages = context.get('has_other_languages', UNDEFINED)
  274. all_languages = context.get('all_languages', UNDEFINED)
  275. generate_atom = context.get('generate_atom', UNDEFINED)
  276. translations_feedorder = context.get('translations_feedorder', UNDEFINED)
  277. translations = context.get('translations', UNDEFINED)
  278. def _html_feed_link(link_type,link_name,link_postfix,classification,kind,language,name=None):
  279. return render__html_feed_link(context,link_type,link_name,link_postfix,classification,kind,language,name)
  280. generate_rss = context.get('generate_rss', UNDEFINED)
  281. __M_writer = context.writer()
  282. __M_writer('\n')
  283. if generate_atom or generate_rss:
  284. if len(translations) > 1 and has_other_languages and kind != 'index':
  285. for language, classification, name in all_languages:
  286. __M_writer(' <p class="feedlink">\n')
  287. if generate_atom:
  288. __M_writer(' ')
  289. __M_writer(str(_html_feed_link('application/atom+xml', 'Atom feed', 'atom', classification, kind, language, name)))
  290. __M_writer('\n')
  291. if generate_rss and kind != 'archive':
  292. __M_writer(' ')
  293. __M_writer(str(_html_feed_link('application/rss+xml', 'RSS feed', 'rss', classification, kind, language, name)))
  294. __M_writer('\n')
  295. __M_writer(' </p>\n')
  296. else:
  297. for language in translations_feedorder:
  298. __M_writer(' <p class="feedlink">\n')
  299. if generate_atom:
  300. __M_writer(' ')
  301. __M_writer(str(_html_feed_link('application/atom+xml', 'Atom feed', 'atom', classification, kind, language)))
  302. __M_writer('\n')
  303. if generate_rss and kind != 'archive':
  304. __M_writer(' ')
  305. __M_writer(str(_html_feed_link('application/rss+xml', 'RSS feed', 'rss', classification, kind, language)))
  306. __M_writer('\n')
  307. __M_writer(' </p>\n')
  308. return ''
  309. finally:
  310. context.caller_stack._pop_frame()
  311. def render_translation_link(context,kind):
  312. __M_caller = context.caller_stack._push_frame()
  313. try:
  314. messages = context.get('messages', UNDEFINED)
  315. has_other_languages = context.get('has_other_languages', UNDEFINED)
  316. def _html_translation_link(classification,kind,language,name=None):
  317. return render__html_translation_link(context,classification,kind,language,name)
  318. other_languages = context.get('other_languages', UNDEFINED)
  319. __M_writer = context.writer()
  320. __M_writer('\n')
  321. if has_other_languages and other_languages:
  322. __M_writer(' <div class="translationslist translations">\n <h3 class="translationslist-intro">')
  323. __M_writer(str(messages("Also available in:")))
  324. __M_writer('</h3>\n')
  325. for language, classification, name in other_languages:
  326. __M_writer(' <p>')
  327. __M_writer(str(_html_translation_link(classification, kind, language, name)))
  328. __M_writer('</p>\n')
  329. __M_writer(' </div>\n')
  330. return ''
  331. finally:
  332. context.caller_stack._pop_frame()
  333. """
  334. __M_BEGIN_METADATA
  335. {"filename": "/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/feeds_translations_helper.tmpl", "uri": "feeds_translations_helper.tmpl", "source_encoding": "utf-8", "line_map": {"16": 0, "21": 2, "22": 9, "23": 25, "24": 33, "25": 54, "26": 72, "27": 85, "28": 113, "29": 124, "35": 3, "42": 3, "43": 4, "44": 5, "45": 5, "46": 5, "47": 5, "48": 5, "49": 5, "50": 5, "51": 5, "52": 5, "53": 5, "54": 5, "55": 6, "56": 7, "57": 7, "58": 7, "59": 7, "60": 7, "61": 7, "62": 7, "63": 7, "64": 7, "70": 11, "78": 11, "79": 12, "80": 13, "81": 14, "82": 14, "83": 14, "84": 14, "85": 14, "86": 14, "87": 14, "88": 14, "89": 14, "90": 14, "91": 14, "92": 14, "93": 14, "94": 15, "95": 16, "96": 16, "97": 16, "98": 16, "99": 16, "100": 16, "101": 16, "102": 16, "103": 16, "104": 16, "105": 16, "106": 18, "107": 19, "108": 20, "109": 20, "110": 20, "111": 20, "112": 20, "113": 20, "114": 20, "115": 20, "116": 20, "117": 20, "118": 20, "119": 21, "120": 22, "121": 22, "122": 22, "123": 22, "124": 22, "125": 22, "126": 22, "127": 22, "128": 22, "134": 27, "140": 27, "141": 28, "142": 29, "143": 29, "144": 29, "145": 29, "146": 29, "147": 29, "148": 29, "149": 29, "150": 29, "151": 30, "152": 31, "153": 31, "154": 31, "155": 31, "156": 31, "157": 31, "158": 31, "164": 35, "178": 35, "179": 36, "180": 37, "181": 37, "182": 37, "183": 39, "184": 40, "185": 41, "186": 42, "187": 42, "188": 42, "189": 42, "190": 42, "191": 42, "192": 42, "193": 42, "194": 42, "195": 42, "196": 42, "197": 44, "198": 45, "199": 46, "200": 47, "201": 47, "202": 47, "203": 48, "204": 49, "205": 49, "206": 49, "212": 56, "225": 56, "226": 57, "227": 58, "228": 59, "229": 60, "230": 60, "231": 60, "232": 60, "233": 60, "234": 60, "235": 60, "236": 60, "237": 60, "238": 60, "239": 60, "240": 62, "241": 63, "242": 64, "243": 65, "244": 65, "245": 65, "246": 66, "247": 67, "248": 67, "249": 67, "255": 75, "266": 75, "267": 76, "268": 77, "269": 77, "270": 77, "271": 78, "272": 78, "273": 80, "274": 81, "275": 82, "276": 82, "277": 82, "278": 82, "279": 82, "285": 87, "298": 87, "299": 88, "300": 89, "301": 90, "302": 91, "303": 92, "304": 93, "305": 93, "306": 93, "307": 95, "308": 96, "309": 96, "310": 96, "311": 98, "312": 100, "313": 101, "314": 102, "315": 103, "316": 104, "317": 104, "318": 104, "319": 106, "320": 107, "321": 107, "322": 107, "323": 109, "329": 115, "338": 115, "339": 116, "340": 117, "341": 118, "342": 118, "343": 119, "344": 120, "345": 120, "346": 120, "347": 122, "353": 347}}
  336. __M_END_METADATA
  337. """