article.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {% extends "base.html" %}
  2. {% block title %}
  3. {{ article.title }} - {{ super() }}
  4. {% endblock title %}
  5. {% block head_description %}
  6. {% if article.summary %}
  7. {{ article.summary|striptags }}
  8. {% endif %}
  9. {% endblock head_description %}
  10. {% block content %}
  11. <article>
  12. <div class="row-fluid">
  13. <header class="page_header span10 offset2">
  14. <h1><a href="{{ SITEURL }}/{{ article.url }}"> {{ article.title }} {%if article.subtext %} <small> {{ article.subtext }} </small> {% endif %} </a></h1>
  15. </header>
  16. </div>
  17. <div class="row-fluid">
  18. {% if article.toc %}
  19. <div class="span2 table-of-content">
  20. <nav>
  21. <h4>Contents</h4>
  22. {{ article.toc }}
  23. </nav>
  24. </div>
  25. <div class="span8 article-content">
  26. {% else %}
  27. <div class="span8 offset2 article-content">
  28. {% endif %}
  29. {{ article.content }}
  30. <aside>
  31. {% for an_article in dates %}
  32. {% if an_article.url == article.url %}
  33. {% set index = loop.index0 %}
  34. {% if not loop.first %}
  35. {% set next_article = dates[index-1] %}
  36. {% endif %}
  37. {% if not loop.last %}
  38. {% set previous_article = dates[index+1] %}
  39. {% endif %}
  40. <nav>
  41. <ul class="articles_timeline">
  42. {% if previous_article %}
  43. <li class="previous_article">« <a href="{{ SITEURL }}/{{ previous_article.url }}" title="Previous: {{ previous_article.title }}">{{ previous_article.title }}</a></li>
  44. {% endif %}
  45. {% if next_article %}
  46. <li class="next_article"><a href="{{ SITEURL }}/{{ next_article.url }}" title="Next: {{ next_article.title }}">{{ next_article.title }}</a> »</li>
  47. {% endif %}
  48. </ul>
  49. </nav>
  50. {% endif %}
  51. {% endfor %}
  52. </aside>
  53. {% include 'comments.html' %}
  54. </div>
  55. <section>
  56. <div class="span2" style="float:right">
  57. {% if article.date %}
  58. <h4>Published</h4>
  59. {% set day = article.date.strftime('%d')|int %}
  60. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  61. {% endif %}
  62. {% if article.modified %}
  63. <h4>Last Updated</h4>
  64. {{ article.modified }}
  65. {% endif %}
  66. {% if article.category %}
  67. <h4>Category</h4>
  68. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  69. {% endif %}
  70. {% if article.tags %}
  71. <h4>Tags</h4>
  72. <ul class="list-of-tags tags-in-article">
  73. {% for tag in article.tags|sort %}
  74. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  75. {% for aTag, tagged_articles in tags if aTag == tag %}
  76. <span>{{ tagged_articles|count }}</span>
  77. {% endfor %}</a></li>
  78. {% endfor %}
  79. </ul>
  80. {% endif %}
  81. {% if MAILCHIMP_FORM_ACTION %}
  82. {% if not EMAIL_SUBSCRIPTION_LABEL %}
  83. {% set EMAIL_SUBSCRIPTION_LABEL='Email Newsletter' %}
  84. {% endif %}
  85. {% if not SUBSCRIBE_BUTTON_TITLE %}
  86. {% set SUBSCRIBE_BUTTON_TITLE='Subscribe' %}
  87. {% endif %}
  88. {% if not EMAIL_PLACEHOLDER %}
  89. {% set EMAIL_PLACEHOLDER ='email address' %}
  90. {% endif %}
  91. <!-- Begin MailChimp Signup Form -->
  92. <div id="mc_embed_signup">
  93. <form action="{{ MAILCHIMP_FORM_ACTION }}" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
  94. <label for="mce-EMAIL">{{ EMAIL_SUBSCRIPTION_LABEL }}</label>
  95. <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="{{ EMAIL_FIELD_PLACEHOLDER }}" required>
  96. <div class="clear"><input type="submit" value="{{ SUBSCRIBE_BUTTON_TITLE }}" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
  97. </form>
  98. </div>
  99. <!--End mc_embed_signup-->
  100. {% endif %}
  101. </div>
  102. </section>
  103. </div>
  104. </article>
  105. {% endblock content %}
  106. {% block script %}
  107. {{ super() }}
  108. {% include 'disqus_script_count.html' %}
  109. {% endblock script %}