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

base_helper.tmpl 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. ## -*- coding: utf-8 -*-
  2. <%namespace name="notes" file="annotation_helper.tmpl" import="*" />
  3. <%namespace name="feeds_translations" file="feeds_translations_helper.tmpl" import="*"/>
  4. <%def name="html_headstart()">
  5. <!DOCTYPE html>
  6. <html
  7. \
  8. % if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook'):
  9. prefix='\
  10. %if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
  11. og: http://ogp.me/ns# \
  12. %endif
  13. %if use_open_graph:
  14. article: http://ogp.me/ns/article# \
  15. %endif
  16. %if comment_system == 'facebook':
  17. fb: http://ogp.me/ns/fb# \
  18. %endif
  19. '\
  20. %endif
  21. \
  22. % if is_rtl:
  23. dir="rtl" \
  24. % endif
  25. \
  26. lang="${lang}">
  27. <head>
  28. <meta charset="utf-8">
  29. % if use_base_tag:
  30. <base href="${abs_link(permalink)}">
  31. % endif
  32. %if description:
  33. <meta name="description" content="${description|h}">
  34. %endif
  35. <meta name="viewport" content="width=device-width, initial-scale=1">
  36. %if title == blog_title:
  37. <title>${blog_title|h}</title>
  38. %else:
  39. <title>${title|h} | ${blog_title|h}</title>
  40. %endif
  41. ${html_stylesheets()}
  42. <meta name="theme-color" content="${theme_color}">
  43. % if meta_generator_tag:
  44. <meta name="generator" content="Nikola (getnikola.com)">
  45. % endif
  46. ${feeds_translations.head(classification=None, kind='index', other=False)}
  47. <link rel="canonical" href="${abs_link(permalink)}">
  48. %if favicons:
  49. %for name, file, size in favicons:
  50. <link rel="${name}" href="${file}" sizes="${size}"/>
  51. %endfor
  52. %endif
  53. % if comment_system == 'facebook':
  54. <meta property="fb:app_id" content="${comment_system_id}">
  55. % endif
  56. %if prevlink:
  57. <link rel="prev" href="${prevlink}" type="text/html">
  58. %endif
  59. %if nextlink:
  60. <link rel="next" href="${nextlink}" type="text/html">
  61. %endif
  62. %if use_cdn:
  63. <!--[if lt IE 9]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  64. %else:
  65. <!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang, url_type)}"></script><![endif]-->
  66. %endif
  67. ${extra_head_data}
  68. </%def>
  69. <%def name="late_load_js()">
  70. %if use_bundles:
  71. %if use_cdn:
  72. <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
  73. <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js" integrity="sha384-vhJnz1OVIdLktyixHY4Uk3OHEwdQqPppqYR8+5mjsauETgLOcEynD9oPHhhz18Nw" crossorigin="anonymous"></script>
  74. <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.js" integrity="sha256-SoEATAB7PgNWyyK100I7yQXYm5V08k5SFupDP0h72MY=" crossorigin="anonymous"></script>
  75. <script src="/assets/js/all.js"></script>
  76. %else:
  77. <script src="/assets/js/all-nocdn.js"></script>
  78. %endif
  79. %else:
  80. %if use_cdn:
  81. <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
  82. <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js" integrity="sha384-vhJnz1OVIdLktyixHY4Uk3OHEwdQqPppqYR8+5mjsauETgLOcEynD9oPHhhz18Nw" crossorigin="anonymous"></script>
  83. <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.js" integrity="sha256-SoEATAB7PgNWyyK100I7yQXYm5V08k5SFupDP0h72MY=" crossorigin="anonymous"></script>
  84. %else:
  85. <script src="/assets/js/jquery.min.js"></script>
  86. <script src="/assets/js/bootstrap.min.js"></script>
  87. <script src="/assets/js/baguetteBox.min.js"></script>
  88. %endif
  89. <script src="/assets/js/moment-with-locales.min.js"></script>
  90. <script src="/assets/js/fancydates.min.js"></script>
  91. %endif
  92. ${social_buttons_code}
  93. </%def>
  94. <%def name="html_stylesheets()">
  95. %if use_bundles:
  96. %if use_cdn:
  97. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" integrity="sha384-PmY9l28YgO4JwMKbTvgaS7XNZJ30MK9FAZjjzXtlqyZCqBY6X6bXIkM++IkyinN+" crossorigin="anonymous">
  98. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />
  99. <link href="/assets/css/all.css" rel="stylesheet" type="text/css">
  100. %else:
  101. <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
  102. %endif
  103. %else:
  104. %if use_cdn:
  105. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" integrity="sha384-PmY9l28YgO4JwMKbTvgaS7XNZJ30MK9FAZjjzXtlqyZCqBY6X6bXIkM++IkyinN+" crossorigin="anonymous">
  106. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />
  107. %else:
  108. <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  109. <link href="/assets/css/baguetteBox.min.css" rel="stylesheet" type="text/css">
  110. %endif
  111. <link href="/assets/css/rst_base.css" rel="stylesheet" type="text/css">
  112. <link href="/assets/css/nikola_rst.css" rel="stylesheet" type="text/css">
  113. <link href="/assets/css/code.css" rel="stylesheet" type="text/css">
  114. <link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
  115. %if has_custom_css:
  116. <link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
  117. %endif
  118. %endif
  119. % if needs_ipython_css:
  120. <link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css">
  121. <link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">
  122. % endif
  123. </%def>
  124. <%def name="html_navigation_links()">
  125. %for url, text in navigation_links[lang]:
  126. % if isinstance(url, tuple):
  127. <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">${text} <b class="caret"></b></a>
  128. <ul class="dropdown-menu">
  129. %for suburl, text in url:
  130. % if rel_link(permalink, suburl) == "#":
  131. <li class="active"><a href="${permalink}">${text} <span class="sr-only">${messages("(active)", lang)}</span></a>
  132. %else:
  133. <li><a href="${suburl}">${text}</a>
  134. %endif
  135. %endfor
  136. </ul>
  137. % else:
  138. % if rel_link(permalink, url) == "#":
  139. <li class="active"><a href="${permalink}">${text} <span class="sr-only">${messages("(active)", lang)}</span></a>
  140. %else:
  141. <li><a href="${url}">${text}</a>
  142. %endif
  143. % endif
  144. %endfor
  145. </%def>
  146. <%def name="html_feedlinks()">
  147. ${feeds_translations.head(classification=None, kind='index', other=False)}
  148. </%def>
  149. <%def name="html_translations()">
  150. %for langname in sorted(translations):
  151. %if langname != lang:
  152. <li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
  153. %endif
  154. %endfor
  155. </%def>