base.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. {% macro ephemeral_nav_link(what, where, selected=False) -%}
  2. <li class="ephemeral{% if selected %} selected{% endif %}"><a href="{{ SITEURL }}/{{ where }}">{{what}}</a></li>
  3. {%- endmacro -%}
  4. <!DOCTYPE html>
  5. <html lang="{{ DEFAULT_LANG }}">
  6. <head>
  7. {% block head %}
  8. <meta charset="utf-8" />
  9. <meta name="viewport" content="width=device-width,initial-scale=1">
  10. <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
  11. {# favicon #}
  12. <link rel="shortcut icon" type="image/png" href="{{ SITEURL }}/favicon.png" sizes="16x16">
  13. <link rel="shortcut icon" type="image/x-icon" href="{{ SITEURL }}/favicon.ico" sizes="32x32 48x48">
  14. {% if FEED_ALL_ATOM %}
  15. <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
  16. {% endif %}
  17. {% if FEED_ALL_RSS %}
  18. <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
  19. {% endif %}
  20. {% if FEED_ATOM %}
  21. <link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
  22. {% endif %}
  23. {% if FEED_RSS %}
  24. <link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
  25. {% endif %}
  26. {% if TRANSLATION_FEED_ATOM %}
  27. {% for lang in LANGS %}
  28. {% set translation_feed = 'feeds/all-%s.atom.xml' % (lang) %}
  29. <link href="{{ FEED_DOMAIN }}/{{ translation_feed }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ lang }} Translation Atom Feed" />
  30. {% endfor %}
  31. {% endif %}
  32. {% if CATEGORY_FEED_ATOM and category %}
  33. <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
  34. {% endif %}
  35. {% if CATEGORY_FEED_RSS and category %}
  36. <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
  37. {% endif %}
  38. {% if TAG_FEED_ATOM and tag %}
  39. <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
  40. {% endif %}
  41. {% if TAG_FEED_RSS and tag %}
  42. <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
  43. {% endif %}
  44. <link rel="stylesheet" href="{{ SITEURL }}/theme/css/screen.css" type="text/css" />
  45. <link rel="stylesheet" href="{{ SITEURL }}/theme/css/pygments.css" type="text/css" />
  46. <link rel="stylesheet" href="{{ SITEURL }}/theme/css/print.css" type="text/css" media="print" />
  47. <meta name="generator" content="Pelican" />
  48. <meta name="description" content="{{ SITEDESCRIPTION }}">
  49. <meta name="author" content="{{ AUTHOR }}">
  50. {% endblock head %}
  51. </head>
  52. <body>
  53. {% if DISPLAY_HEADER or DISPLAY_HEADER is not defined %}
  54. <header>
  55. {% if DISPLAY_MENU or DISPLAY_MENU is not defined %}
  56. <nav>
  57. <ul>
  58. {% block ephemeral_nav %}{% endblock %}
  59. {% if DISPLAY_HOME or DISPLAY_HOME is not defined %}
  60. <li{% if output_file == "index.html" %} class="selected"{% endif %}><a href="{{ SITEURL }}/">Home</a></li>
  61. {% endif %}
  62. {% if DISPLAY_PAGES_ON_MENU %}
  63. {% for p in pages %}
  64. <li{% if p == page %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
  65. {% endfor %}
  66. {% endif %}
  67. {% for title, link in MENUITEMS %}
  68. <li><a href="{{ link }}">{{ title }}</a></li>
  69. {% endfor %}
  70. {% for name, link, file in MENU_INTERNAL_PAGES %}
  71. <li{% if output_file == file %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ link }}">{{ name }}</a></li>
  72. {% endfor %}
  73. </ul>
  74. </nav>
  75. {% endif %}
  76. <div class="header_box">
  77. <h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>
  78. {% if SITESUBTITLE %}
  79. <h2>{{ SITESUBTITLE }}</h2>
  80. {% endif %}
  81. </div>
  82. </header>
  83. {% endif %}
  84. <div id="wrapper">
  85. <div id="content">
  86. {%- block content -%}{%- endblock %}
  87. {% if DISPLAY_FOOTER or DISPLAY_FOOTER is not defined %}
  88. <div class="clear"></div>
  89. <footer>
  90. <p>
  91. {% if FEED_ALL_ATOM %}
  92. &middot;
  93. <a href="{{ SITEURL }}/{{ FEED_ALL_ATOM }}" rel="alternate">Atom Feed</a>
  94. {% endif %}
  95. {% if FEED_ALL_RSS %}
  96. &middot;
  97. <a href="{{ SITEURL }}/{{ FEED_ALL_RSS }}" rel="alternate">Rss Feed</a>
  98. {% endif %}
  99. {% if TRANSLATION_FEED_ATOM %}
  100. {% for lang in LANGS %}
  101. {% set translation_feed = 'feeds/all-%s.atom.xml' % (lang) %}
  102. <a class="follow" href="{{ FEED_DOMAIN }}/{{ translation_feed }}" rel="alternate">Atom Feed ({{ lang }})</a>
  103. &middot;
  104. {% endfor %}
  105. {% endif %}
  106. {% if SOCIAL %}
  107. {% for name, link in SOCIAL %}
  108. <a class="follow" href="{{ link }}">{{ name }}</a>
  109. {% endfor %}
  110. {% endif %}
  111. <br>
  112. <a href="https://notabug.org/Ducker/ducker-website-theme">Ducker website theme</a>
  113. &middot;
  114. Powered by <a href="http://getpelican.com">Pelican</a>
  115. </footer>
  116. {% endif %}
  117. </div>
  118. <div class="clear"></div>
  119. </div>
  120. </body>
  121. </html>