Fix some issues with the lw-timeago plugin
diff --git a/static/js/lw-timeago b/static/js/lw-timeago
index b6a09a3..4ec306b 160000
--- a/static/js/lw-timeago
+++ b/static/js/lw-timeago
@@ -1 +1 @@
-Subproject commit b6a09a39eb432418c603c7b0583aa961ae425209
+Subproject commit 4ec306b181abad6305e469fffe288e806eb540e4
diff --git a/templates/article.html b/templates/article.html
index c6a8582..ecfa34e 100644
--- a/templates/article.html
+++ b/templates/article.html
@@ -6,6 +6,10 @@
{%- if article.tags -%}{{', '}}{%- endif -%}
{%- endif -%}
{{article.tags|join(', ') }}">
+
+ {% if FUZZY_DATES %}
+ <script src="{{ SITEURL }}/theme/js/lw-timeago/lw-timeago.js" type="text/javascript"></script>
+ {% endif %}
{% endblock %}
{% block title %}{{ article.title|striptags|escape }} | {{ SITENAME }}{% endblock %}
@@ -20,12 +24,12 @@
{{ article.content }}
</div>
<div class="article_meta">
- <p>Posted <time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
+ <p>Posted <time data-timeago datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
{% if article.author %}
by {% if AUTHORS_URL %} <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a>{% else %}{{ article.author}}{% endif %}
{% endif %}
{% if article.modified %}
- <p>Last updated <time datetime="{{ article.modified.isoformat() }}">{{ article.locale_modified }}</time></p>
+ <p>Last updated <time data-timeago datetime="{{ article.modified.isoformat() }}">{{ article.locale_modified }}</time></p>
{% endif %}
</p>
<p>
@@ -56,14 +60,6 @@
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
{% endif %}
-
- {% if FUZZY_DATES %}
- {% block scripts %}
- {{ super() }}
- <script type="text/javascript">window.addEventListener('load', function(){lw_timeago.doReplace()})</script>
- {% endblock %}
- {% endif %}
-
</article>
{% endblock %}
diff --git a/templates/base.html b/templates/base.html
index 3ba7ea0..6a51f3e 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -9,10 +9,6 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.2.0/less.min.js" type="text/javascript"></script>
{% endif %}
- {% if FUZZY_DATES %}
- <script src="{{ SITEURL }}/theme/js/lw-timeago/lw-timeago.js" type="text/javascript"></script>
- {% endif %}
-
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/pygments.css">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">