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.
 
 
 
 

142 lines
5.8 KiB

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