article.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. {% extends "base.html" %}
  2. {% block title %}
  3. {{ article.title }} - {{ super() }}
  4. {% endblock title %}
  5. {% block content %}
  6. <script language="javascript" type="text/javascript">
  7. function moveTOC() {
  8. var table_of_contents = document.getElementById('contents');
  9. var toc_sidebar = document.getElementById('toc_sidebar');
  10. if (table_of_contents && toc_sidebar)
  11. toc_sidebar.appendChild(table_of_contents);
  12. }
  13. </script>
  14. <div class="row-fluid">
  15. <header class="page_header span7 offset3">
  16. <h1> {{ article.title }} <small> {%if article.subtext %} {{ article.subtext }} {% endif %} </small></h1>
  17. </header>
  18. </div>
  19. <div class="row-fluid">
  20. <div class="span3" id="toc_sidebar">
  21. </div>
  22. <div class="span7 article-content">
  23. {{ article.content }}
  24. <div class="row-fluid">
  25. <div class="span12">
  26. {% if article.tags %}
  27. <h4>Tags</h4>
  28. <ul class="list-of-tags">
  29. {% for tag in article.tags %}
  30. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  31. {% for aTag, tagged_articles in tags if aTag == tag %}
  32. <span>{{ tagged_articles|count }}</span>
  33. {% endfor %}</a></li>
  34. {% endfor %}
  35. </ul>
  36. {% endif %}
  37. </div>
  38. </div>
  39. </div>
  40. <div class="span2">
  41. <div class="row-fluid">
  42. <div class="span12">
  43. <p>
  44. {% set day = article.date.strftime('%d')|int %}
  45. {% set suffix = ['st', 'nd', 'rd', 'th'] %}
  46. {{ article.date.strftime('%b') }} {{ day }}
  47. {%- if 4 <= day <= 20 or 24 <= day <= 30 -%} {{ suffix[3] }}
  48. {%- elif day % 10 - 1 == 0 -%} {{ suffix[0] }}
  49. {%- elif day % 10 - 1 == 1 -%} {{ suffix[1] }}
  50. {%- elif day % 10 - 1 == 2 -%} {{ suffix[2] }}
  51. {%- endif -%}
  52. {{ article.date.strftime(', %Y') }}
  53. </p>
  54. <p>
  55. Published by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> in <a href="{{ SITEURL }}/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  56. </p>
  57. {% if article.modified %}
  58. <p>Updated on {{ article.modified }}
  59. </p>
  60. {% endif %}
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <script type="text/javascript" language="JavaScript">
  66. moveTOC();
  67. </script>
  68. {% endblock content %}