article.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.subtitle %} <small> {{ article.subtitle }} </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. {% set ptitle = previous_article.title %}
  44. {% set pv_title = ptitle %}
  45. {%if previous_article.subtitle %}
  46. {% set pv_title = ptitle + " " + "<small>" + previous_article.subtitle + "</small>" %}
  47. {% set ptitle = ptitle + " - " + previous_article.subtitle %}
  48. {% endif %}
  49. <li class="previous_article">« <a href="{{ SITEURL }}/{{ previous_article.url }}" title="Previous: {{ ptitle }}">{{ pv_title }}</a></li>
  50. {% endif %}
  51. {% if next_article %}
  52. {% set ntitle = next_article.title %}
  53. {% set nv_title = ntitle %}
  54. {%if next_article.subtitle %}
  55. {% set nv_title = ntitle + " " + "<small>" + next_article.subtitle + "</small>" %}
  56. {% set ntitle = ntitle + " - " + next_article.subtitle %}
  57. {% endif %}
  58. <li class="next_article"><a href="{{ SITEURL }}/{{ next_article.url }}" title="Next: {{ ntitle }}">{{ nv_title }}</a> »</li>
  59. {% endif %}
  60. </ul>
  61. </nav>
  62. {% endif %}
  63. {% endfor %}
  64. </aside>
  65. {% include 'comments.html' %}
  66. </div>
  67. <section>
  68. <div class="span2" style="float:right;font-size:0.9em;">
  69. {% if article.date %}
  70. <h4>Published</h4>
  71. {% set day = article.date.strftime('%d')|int %}
  72. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
  73. {% endif %}
  74. {% if article.modified %}
  75. <h4>Last Updated</h4>
  76. {{ article.modified }}
  77. {% endif %}
  78. {% if article.category %}
  79. <h4>Category</h4>
  80. <a class="category-link" href="/categories.html#{{ category|replace(' ', '-')|e }}-ref">{{ article.category }}</a>
  81. {% endif %}
  82. {% if article.tags %}
  83. <h4>Tags</h4>
  84. <ul class="list-of-tags tags-in-article">
  85. {% for tag in article.tags|sort %}
  86. <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
  87. {% for aTag, tagged_articles in tags if aTag == tag %}
  88. <span>{{ tagged_articles|count }}</span>
  89. {% endfor %}</a></li>
  90. {% endfor %}
  91. </ul>
  92. {% endif %}
  93. {% if MAILCHIMP_FORM_ACTION %}
  94. {% if not EMAIL_SUBSCRIPTION_LABEL %}
  95. {% set EMAIL_SUBSCRIPTION_LABEL='Email Newsletter' %}
  96. {% endif %}
  97. {% if not SUBSCRIBE_BUTTON_TITLE %}
  98. {% set SUBSCRIBE_BUTTON_TITLE='Subscribe' %}
  99. {% endif %}
  100. {% if not EMAIL_PLACEHOLDER %}
  101. {% set EMAIL_PLACEHOLDER ='email address' %}
  102. {% endif %}
  103. <!-- Begin MailChimp Signup Form -->
  104. <div id="mc_embed_signup">
  105. <form action="{{ MAILCHIMP_FORM_ACTION }}" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
  106. <h4>{{ EMAIL_SUBSCRIPTION_LABEL }}</h4>
  107. <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="{{ EMAIL_FIELD_PLACEHOLDER }}" required>
  108. <div class="clear"><input type="submit" value="{{ SUBSCRIBE_BUTTON_TITLE }}" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
  109. </form>
  110. </div>
  111. <!--End mc_embed_signup-->
  112. {% endif %}
  113. </div>
  114. </section>
  115. </div>
  116. </article>
  117. {% endblock content %}
  118. {% block script %}
  119. {{ super() }}
  120. {% include 'disqus_script_count.html' %}
  121. {% endblock script %}