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

base_helper.tmpl 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ## -*- coding: utf-8 -*-
  2. <%def name="html_headstart()">
  3. <!DOCTYPE html>
  4. <html
  5. \
  6. % if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook'):
  7. prefix='\
  8. %if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
  9. og: http://ogp.me/ns# \
  10. %endif
  11. %if use_open_graph:
  12. article: http://ogp.me/ns/article# \
  13. %endif
  14. %if comment_system == 'facebook':
  15. fb: http://ogp.me/ns/fb# \
  16. %endif
  17. '\
  18. %endif
  19. \
  20. % if is_rtl:
  21. dir="rtl" \
  22. % endif
  23. \
  24. lang="${lang}">
  25. <head>
  26. <meta charset="utf-8">
  27. %if description:
  28. <meta name="description" content="${description}">
  29. %endif
  30. <meta name="viewport" content="width=device-width, initial-scale=1">
  31. <title>${title|striphtml} | ${blog_title|striphtml}</title>
  32. ${html_stylesheets()}
  33. ${html_feedlinks()}
  34. %if permalink:
  35. <link rel="canonical" href="${abs_link(permalink)}">
  36. %endif
  37. %if favicons:
  38. %for name, file, size in favicons:
  39. <link rel="${name}" href="${file}" sizes="${size}"/>
  40. %endfor
  41. %endif
  42. % if comment_system == 'facebook':
  43. <meta property="fb:app_id" content="${comment_system_id}">
  44. % endif
  45. %if prevlink:
  46. <link rel="prev" href="${prevlink}" type="text/html">
  47. %endif
  48. %if nextlink:
  49. <link rel="next" href="${nextlink}" type="text/html">
  50. %endif
  51. %if use_cdn:
  52. <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  53. %else:
  54. <!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]-->
  55. %endif
  56. ${extra_head_data}
  57. </%def>
  58. <%def name="late_load_js()">
  59. %if use_bundles:
  60. %if use_cdn:
  61. <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
  62. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  63. <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.js" integrity="sha256-SoEATAB7PgNWyyK100I7yQXYm5V08k5SFupDP0h72MY=" crossorigin="anonymous"></script>
  64. <script src="/assets/js/all.js"></script>
  65. %else:
  66. <script src="/assets/js/all-nocdn.js"></script>
  67. %endif
  68. %else:
  69. %if use_cdn:
  70. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
  71. <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  72. %else:
  73. <script src="/assets/js/jquery.min.js"></script>
  74. <script src="/assets/js/bootstrap.min.js"></script>
  75. <script src="/assets/js/baguetteBox.min.js"></script>
  76. %endif
  77. <script src="/assets/js/moment-with-locales.min.js"></script>
  78. <script src="/assets/js/fancydates.min.js"></script>
  79. %endif
  80. ${social_buttons_code}
  81. </%def>
  82. <%def name="html_stylesheets()">
  83. %if use_bundles:
  84. %if use_cdn:
  85. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  86. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />
  87. <link href="/assets/css/all.css" rel="stylesheet" type="text/css">
  88. %else:
  89. <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
  90. %endif
  91. %else:
  92. %if use_cdn:
  93. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  94. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.1/baguetteBox.min.css" integrity="sha256-GrjD69ygFQ+lWqlAOC6LzoNUE4jKrvgkQJrtIukHAi4=" crossorigin="anonymous" />
  95. %else:
  96. <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  97. <link href="/assets/css/baguetteBox.min.css" rel="stylesheet" type="text/css">
  98. %endif
  99. <link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
  100. <link href="/assets/css/code.css" rel="stylesheet" type="text/css">
  101. <link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
  102. <link href="/assets/css/blog.css" rel="stylesheet" type="text/css">
  103. %if has_custom_css:
  104. <link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
  105. %endif
  106. %endif
  107. % if needs_ipython_css:
  108. <link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css">
  109. <link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">
  110. % endif
  111. </%def>
  112. <%def name="html_navigation_links()">
  113. %for url, text in navigation_links[lang]:
  114. %if rel_link(permalink, url) == "#":
  115. <a href="${permalink}" class="blog-nav-item active">${text} <span class="sr-only">${messages("(active)", lang)}</span></a>
  116. %else:
  117. <a href="${url}" class="blog-nav-item">${text}</a>
  118. %endif
  119. %endfor
  120. </%def>
  121. <%def name="html_feedlinks()">
  122. %if rss_link:
  123. ${rss_link}
  124. %elif generate_rss:
  125. %if len(translations) > 1:
  126. %for language in translations:
  127. <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}">
  128. %endfor
  129. %else:
  130. <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
  131. %endif
  132. %endif
  133. %if generate_atom:
  134. %if len(translations) > 1:
  135. %for language in translations:
  136. <link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
  137. %endfor
  138. %else:
  139. <link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
  140. %endif
  141. %endif
  142. </%def>
  143. <%def name="html_translations()">
  144. %for langname in translations.keys():
  145. %if langname != lang:
  146. <a class="blog-nav-item blog-nav-item-aside" href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a>
  147. %endif
  148. %endfor
  149. </%def>