The blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

139 lines
5.6 KiB

  1. {% from "macros.j2" import itemurl, slug %}
  2. <!doctype html>
  3. <!-- https://github.com/paulirish/html5-boilerplate/blob/master/index.html -->
  4. <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
  5. <!--[if (gte IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
  6. <head>
  7. {% block starthead %}{% endblock starthead %}
  8. <meta charset="{{ resource.meta.charset }}">
  9. <!-- encoding must be specified within the first 512 bytes
  10. www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset -->
  11. <!-- meta element for compatibility mode needs to be before
  12. all elements except title & meta
  13. msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx -->
  14. <!-- Chrome Frame is only invoked if meta element for
  15. compatibility mode is within the first 1K bytes
  16. code.google.com/p/chromium/issues/detail?id=23003 -->
  17. {#
  18. <meta http-equiv="refresh" content="2">
  19. #}
  20. <!-- Twitter cards, OpenGraph and Slack unfurling -->
  21. <meta name="twitter:card" content="summary" />
  22. {% if resource.meta.twittertitle %}
  23. <meta property="og:title" content="{{ resource.meta.twittertitle }}" />
  24. {% else %}
  25. <meta property="og:title" content="{{ resource.meta.title }}" />
  26. {% endif %}
  27. <meta property="og:description" content="{{ resource.meta.description }}" />
  28. {% if resource.meta.image %} <meta property="og:image" content="{{ resource.meta.image }}" />{% endif %}
  29. {% if site.context.tweet_via %} <meta property="twitter:site:id" content="{{ site.context.tweet_via }}" /> {% endif %}
  30. {% if resource.meta.imagealt %} <meta name="twitter:image:alt" content="{{ resource.meta.imagealt }}" />{% endif %}
  31. {% if resource.meta.twitterlabel1 %} <meta name="twitter:label1" content="{{ resource.meta.twitterlabel1 }}" />{% endif %}
  32. {% if resource.meta.twitterlabel2 %} <meta name="twitter:label2" content="{{ resource.meta.twitterlabel2 }}" />{% endif %}
  33. {% if resource.meta.twitterdata1 %} <meta name="twitter:data1" content="{{ resource.meta.twitterdata1 }}" />{% endif %}
  34. {% if resource.meta.twitterdata2 %} <meta name="twitter:data2" content="{{ resource.meta.twitterdata2 }}" />{% endif %}
  35. <title>{% block title %}{{ resource.meta.title }}{% endblock %}</title>
  36. <meta name="description" content="{{ resource.meta.description }}">
  37. <meta name="author" content="{{ resource.meta.author }}">
  38. <!-- Mobile viewport optimized: j.mp/bplateviewport -->
  39. <meta name="viewport" content="{{ resource.meta.viewport or site.context.viewport }}">
  40. {% block css %}
  41. <link rel="stylesheet" href="{{ media_url('css/w3.css') }}">
  42. <link rel="stylesheet" href="{{ media_url('css/tufte.css') }}">
  43. <link rel="stylesheet" href="{{ media_url('css/custom.css') }}">
  44. {% endblock css %}
  45. {% block endhead %}{% endblock endhead %}
  46. </head>
  47. <body class="w3-main" id="{{ slug(resource) }}">
  48. <!-- from: https://www.w3schools.com/w3css/w3css_sidebar.asp -->
  49. <div class="w3-top">
  50. <div class="w3-bar w3-lightgrey">
  51. <button class="w3-bar-item w3-button w3-xlarge w3-right" onclick="w3_open()">☰</button>
  52. </div>
  53. </div>
  54. <div class="w3-sidebar w3-animate-right w3-bar-block w3-collapse" id="mySidebar">
  55. <button class="w3-bar-item w3-button" onclick="w3_close()"><b>Close</b> &times;</button>
  56. {% set hierarchy = node.rwalk()|list %}
  57. {% for yeargrp in hierarchy[-1].walk_resources_sorted_by_time()|groupby("meta.posted.year")|reverse %}
  58. <div class="w3-dropdown-hover w3-dropdown-click">
  59. <button class="w3-button"><b>{{ yeargrp.grouper }}</b> ({{ yeargrp.list|count }}){# font awesome <i class="fa fa-caret-down"></i> #}</button>
  60. <div class="w3-dropdown-content w3-bar-block">
  61. {% for monthgrp in yeargrp.list|groupby("meta.posted.month")|reverse %}
  62. <b><button class="w3-button">{{ monthgrp.list[0].meta.posted|date_format('%B') }}{# font awesome <i class="fa fa-caret-down"></i> #}</button></b>
  63. {% for item in monthgrp.list %}
  64. <div class="w3-dropdown-click w3-bar-block" style="margin-left: 0.75em;">
  65. <a href="{{ itemurl(item) }}" class="no-tufte-underline w3-bar-item w3-button">{{ item.meta.title }}</a>
  66. </div>
  67. {% endfor %}
  68. {% endfor %}
  69. </div>
  70. </div>
  71. {% endfor %}
  72. </div>
  73. {% block content %}
  74. <div class="site" id="main" role="main">
  75. {% block container %}
  76. <header class="banner clearfix title">
  77. {% block header -%}
  78. <h1><a class="no-tufte-underline" href="{{ content_url('/') }}">{{ site.context.title }}</a></h1>
  79. {%- endblock %}
  80. </header>
  81. {% block main %}
  82. {% endblock main %}
  83. {% endblock container %}
  84. <section>
  85. <footer>
  86. <div class="footer tags prevnext">
  87. <ul class="tags footer">
  88. <li><a href="{{ content_url('/atom.xml') }}">Atom Feed</a></li>
  89. <li class="contact"><a href="https://twitter.com/{{ site.context.tweet_via }}">Twitter</a></li>
  90. </ul>
  91. </div>
  92. <div class="copyright">{% block copyright %}
  93. {% endblock copyright %}
  94. </div>
  95. </footer>
  96. </section>
  97. </div>
  98. {% endblock content%}
  99. {% block js %}
  100. <!-- Javascript at the bottom for fast page loading -->
  101. {% block scripts %}
  102. {% endblock scripts %}
  103. <script>
  104. /* incase there is no JS, always make it visible */
  105. document.getElementById("mySidebar").style.display = "none";
  106. function w3_open() {
  107. document.getElementById("mySidebar").style.display = "block";
  108. }
  109. function w3_close() {
  110. document.getElementById("mySidebar").style.display = "none";
  111. }
  112. </script>
  113. <!--[if lt IE 7 ]>
  114. <script src="js/libs/dd_belatedpng.js"></script>
  115. <script>DD_belatedPNG.fix('img, .png_bg'); // Fix any <img> or .png_bg bg-images. Also, please read goo.gl/mZiyb </script>
  116. <![endif]-->
  117. {% endblock js %}
  118. </body>
  119. </html>