From 10fdd0f4f5816a4e7a6b4f10b17213e106cc9563 Mon Sep 17 00:00:00 2001 From: ganziqim Date: Sun, 16 Sep 2018 18:26:53 +0800 Subject: Fix: pelican-bootstrap3 DISQUS bug --- .../templates/includes/comments.html | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'pelican-bootstrap3') diff --git a/pelican-bootstrap3/templates/includes/comments.html b/pelican-bootstrap3/templates/includes/comments.html index b37e2bf..4fe6406 100644 --- a/pelican-bootstrap3/templates/includes/comments.html +++ b/pelican-bootstrap3/templates/includes/comments.html @@ -8,20 +8,24 @@ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = '{{ DISQUS_SITENAME }}'; // required: replace example with your forum shortname - {% if article %} - {% if not DISQUS_NO_ID %} - var disqus_identifier = '{{ article.date|strftime('%Y-%m-') ~ article.slug if DISQUS_ID_PREFIX_SLUG else article.slug }}'; - {% endif %} - var disqus_url = '{{ SITEURL }}/{{ article.url }}'; - {% elif page %} - {% if not DISQUS_NO_ID %} - var disqus_identifier = 'page-{{ page.slug }}'; - {% endif %} - var disqus_url = '{{ SITEURL }}/{{ page.url }}'; - {% endif %} - var disqus_config = function () { this.language = "{{ DEFAULT_LANG }}"; + + {% if article %} + {% if not DISQUS_NO_ID %} + this.page.identifier = '{{ article.date|strftime('%Y-%m-%d-') ~ article.slug }}'; + {% endif %} + {% if SITEURL %} + this.page.url = '{{ SITEURL }}/{{ article.url }}'; + {% endif %} + {% elif page %} + {% if not DISQUS_NO_ID %} + this.page.identifier = 'page-{{ page.slug }}'; + {% endif %} + {% if SITEURL %} + this.page.url = '{{ SITEURL }}/{{ page.url }}'; + {% endif %} + {% endif %} }; /* * * DON'T EDIT BELOW THIS LINE * * */ -- cgit