|
@@ -77,32 +77,11 @@
|
|
|
</aside>
|
|
|
{% endif %}
|
|
|
</div>
|
|
|
+ <style id="numbers"></style>
|
|
|
<section>
|
|
|
<div class="span2" style="float:right;font-size:0.9em;">
|
|
|
- {% if article.date %}
|
|
|
- <h4>Published</h4>
|
|
|
- {% set day = article.date.strftime('%d')|int %}
|
|
|
- <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
|
|
|
- {% endif %}
|
|
|
{% include '_includes/last_updated.html' %}
|
|
|
{% include '_includes/multi_parts.html' %}
|
|
|
- {% if article.category|trim|count > 0 %}
|
|
|
- <h4>Category</h4>
|
|
|
- <a class="category-link" href="{{ SITEURL }}/categories.html#{{ category.slug }}-ref">{{ article.category }}</a>
|
|
|
- {% endif %}
|
|
|
- {% if article.tags and article.tags[0]|trim|count > 0 %}
|
|
|
- <h4>Tags</h4>
|
|
|
- <ul class="list-of-tags tags-in-article">
|
|
|
- {% for tag in article.tags|sort %}
|
|
|
- <li><a href="{{ SITEURL }}/tags.html#{{ tag.slug }}-ref">{{ tag }}
|
|
|
- {% for aTag, tagged_articles in tags if aTag == tag %}
|
|
|
- <span>{{ tagged_articles|count }}</span>
|
|
|
- {% endfor %}</a></li>
|
|
|
- {% endfor %}
|
|
|
- </ul>
|
|
|
- {% endif %}
|
|
|
- {% include '_includes/social_links.html' %}
|
|
|
- {% include '_includes/mailchimp.html' %}
|
|
|
</div>
|
|
|
</section>
|
|
|
</div>
|
|
@@ -113,4 +92,25 @@
|
|
|
{{ super() }}
|
|
|
{% from '_includes/comments.html' import comments_script with context %}
|
|
|
{{ comments_script(article) }}
|
|
|
+
|
|
|
+<script>
|
|
|
+$(document).ready(function() {
|
|
|
+ var maxNum = 0; //how many lines should be prepared (Takin in considersation, there would be more wrappers)
|
|
|
+ $(".article-content").each(function() {//create counter for each .NumeredTextBlock wrapper
|
|
|
+ var line = 1; //start with number 1
|
|
|
+ $("p", this).each(function() {//look for paragraph elements inside wrapper
|
|
|
+ $(this).addClass("line" + line);//add class with line number
|
|
|
+ line++;
|
|
|
+ if (maxNum < line) maxNum = line;//set the maximum number of lines used in HTML DOM for wrapper
|
|
|
+ });
|
|
|
+ });
|
|
|
+ var prepStyle = "";//prepare css style with line numbering
|
|
|
+ while (maxNum--) {//prepare as many styles as the max number in document
|
|
|
+ prepStyle += ".line" + maxNum + ":before{content:'" + maxNum + "'}";
|
|
|
+ }
|
|
|
+ $("#numbers").html(prepStyle);//add prepared styles to the HTML DOM
|
|
|
+ console.log("resulting generated <style id='numbers'>"+prepStyle+"</style>")
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
{% endblock script %}
|