Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ website.
``SITEURL`` is defined (usually is) and either one of ``DISQUS_SITENAME`` or
``ISSO_SITEURL`` are defined!

Disqus Identifier
-----------------

If you are migrated from wordpress or any CMS to pelican, the disqus identifier is different there. In pelican the disqus identifier is URL of an article. So you will lose Disqus discussion for that article because Disqus identifier for that article is changed. To override the disqus identifier of an article

- ``disqus_identifier``: set this property in your article meta data. Set it to any unique string you want. It won’t be affected by the article URL.

If you choose not to use ``disqus_identifier``, defaults article URL passes to Disqus as identifier.

X min read
----------

Expand Down
6 changes: 5 additions & 1 deletion templates/_includes/disqus_script.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<script type="text/javascript">
var disqus_shortname = '{{ DISQUS_SITENAME }}';
{% if article %}
var disqus_identifier = '/{{ article.url }}';
{% if article.disqus_identifier %}
var disqus_identifier = '{{ article.disqus_identifier }}';
{% else %}
var disqus_identifier = '/{{ article.url }}';
{% endif %}
var disqus_url = '{{ SITEURL }}/{{ article.url }}';
var disqus_title = '{{ article.title|replace("'", "\\'") }}';
{% endif %}
Expand Down