article.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 span10 offset2">
  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="span2" id="toc_sidebar">
  21. </div>
  22. <div class="span6 article-content">
  23. {{ article.content }}
  24. </div>
  25. <div class="span3 offset1">
  26. <div class="row-fluid">
  27. <div class="span12">
  28. <p>
  29. {% set day = article.date.strftime('%d')|int %}
  30. {% set suffix = ['st', 'nd', 'rd', 'th'] %}
  31. {{ article.date.strftime('%b') }} {{ day }}
  32. {%- if 4 <= day <= 20 or 24 <= day <= 30 -%} {{ suffix[3] }}
  33. {%- elif day % 10 - 1 == 0 -%} {{ suffix[0] }}
  34. {%- elif day % 10 - 1 == 1 -%} {{ suffix[1] }}
  35. {%- elif day % 10 - 1 == 2 -%} {{ suffix[2] }}
  36. {%- endif -%}
  37. {{ article.date.strftime(', %Y') }}
  38. </p>
  39. <p>
  40. Published by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> in <a href="{{ SITEURL }}/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  41. </p>
  42. {% if article.modified %}
  43. <p>Updated on {{ article.modified }}
  44. </p>
  45. {% endif %}
  46. </div>
  47. </div>
  48. <div class="row-fluid">
  49. <div class="span12">
  50. {% if article.tags %}
  51. <h4>Tags</h4>
  52. <ul class="list-of-tags">
  53. {% for tag in article.tags %}
  54. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  55. {% for aTag, tagged_articles in tags if aTag == tag %}
  56. <span>{{ tagged_articles|count }}</span>
  57. {% endfor %}</a></li>
  58. {% endfor %}
  59. </ul>
  60. {% endif %}
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <script type="text/javascript" language="JavaScript">
  66. moveTOC();
  67. </script>
  68. {% endblock content %}