-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3546 from pieterdavid/commentplugins
Allow adding comment systems from plugins
- Loading branch information
Showing
14 changed files
with
81 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 4 additions & 52 deletions
56
nikola/data/themes/base-jinja/templates/comments_helper.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,15 @@ | ||
{# -*- coding: utf-8 -*- #} | ||
|
||
{% import 'comments_helper_disqus.tmpl' as disqus with context %} | ||
{% import 'comments_helper_intensedebate.tmpl' as intensedebate with context %} | ||
{% import 'comments_helper_muut.tmpl' as muut with context %} | ||
{% import 'comments_helper_facebook.tmpl' as facebook with context %} | ||
{% import 'comments_helper_isso.tmpl' as isso with context %} | ||
{% import 'comments_helper_commento.tmpl' as commento with context %} | ||
{% import 'comments_helper_utterances.tmpl' as utterances with context %} | ||
{% import 'comments_helper_%s.tmpl' % comment_system as comments_helper_impl with context %} | ||
|
||
{% macro comment_form(url, title, identifier) %} | ||
{% if comment_system == 'disqus' %} | ||
{{ disqus.comment_form(url, title, identifier) }} | ||
{% elif comment_system == 'intensedebate' %} | ||
{{ intensedebate.comment_form(url, title, identifier) }} | ||
{% elif comment_system == 'muut' %} | ||
{{ muut.comment_form(url, title, identifier) }} | ||
{% elif comment_system == 'facebook' %} | ||
{{ facebook.comment_form(url, title, identifier) }} | ||
{% elif comment_system == 'isso' %} | ||
{{ isso.comment_form(url, title, identifier) }} | ||
{% elif comment_system == 'commento' %} | ||
{{ commento.comment_form(url, title, identifier) }} | ||
{% elif comment_system == 'utterances' %} | ||
{{ utterances.comment_form(url, title, identifier) }} | ||
{% endif %} | ||
{{ comments_helper_impl.comment_form(url, title, identifier) }} | ||
{% endmacro %} | ||
|
||
{% macro comment_link(link, identifier) %} | ||
{% if comment_system == 'disqus' %} | ||
{{ disqus.comment_link(link, identifier) }} | ||
{% elif comment_system == 'intensedebate' %} | ||
{{ intensedebate.comment_link(link, identifier) }} | ||
{% elif comment_system == 'muut' %} | ||
{{ muut.comment_link(link, identifier) }} | ||
{% elif comment_system == 'facebook' %} | ||
{{ facebook.comment_link(link, identifier) }} | ||
{% elif comment_system == 'isso' %} | ||
{{ isso.comment_link(link, identifier) }} | ||
{% elif comment_system == 'commento' %} | ||
{{ commento.comment_link(link, identifier) }} | ||
{% elif comment_system == 'utterances' %} | ||
{{ utterances.comment_link(link, identifier) }} | ||
{% endif %} | ||
{{ comments_helper_impl.comment_link(link, identifier) }} | ||
{% endmacro %} | ||
|
||
{% macro comment_link_script() %} | ||
{% if comment_system == 'disqus' %} | ||
{{ disqus.comment_link_script() }} | ||
{% elif comment_system == 'intensedebate' %} | ||
{{ intensedebate.comment_link_script() }} | ||
{% elif comment_system == 'muut' %} | ||
{{ muut.comment_link_script() }} | ||
{% elif comment_system == 'facebook' %} | ||
{{ facebook.comment_link_script() }} | ||
{% elif comment_system == 'isso' %} | ||
{{ isso.comment_link_script() }} | ||
{% elif comment_system == 'commento' %} | ||
{{ commento.comment_link_script() }} | ||
{% elif comment_system == 'utterances' %} | ||
{{ utterances.comment_link_script() }} | ||
{% endif %} | ||
{{ comments_helper_impl.comment_link_script() }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,15 @@ | ||
## -*- coding: utf-8 -*- | ||
|
||
<%namespace name="disqus" file="comments_helper_disqus.tmpl"/> | ||
<%namespace name="intensedebate" file="comments_helper_intensedebate.tmpl"/> | ||
<%namespace name="muut" file="comments_helper_muut.tmpl"/> | ||
<%namespace name="facebook" file="comments_helper_facebook.tmpl"/> | ||
<%namespace name="isso" file="comments_helper_isso.tmpl"/> | ||
<%namespace name="commento" file="comments_helper_commento.tmpl"/> | ||
<%namespace name="utterances" file="comments_helper_utterances.tmpl"/> | ||
<%namespace name="comments_helper_impl" file="comments_helper_${context['comment_system']}.tmpl"/> | ||
|
||
<%def name="comment_form(url, title, identifier)"> | ||
%if comment_system == 'disqus': | ||
${disqus.comment_form(url, title, identifier)} | ||
% elif comment_system == 'intensedebate': | ||
${intensedebate.comment_form(url, title, identifier)} | ||
% elif comment_system == 'muut': | ||
${muut.comment_form(url, title, identifier)} | ||
% elif comment_system == 'facebook': | ||
${facebook.comment_form(url, title, identifier)} | ||
% elif comment_system == 'isso': | ||
${isso.comment_form(url, title, identifier)} | ||
% elif comment_system == 'commento': | ||
${commento.comment_form(url, title, identifier)} | ||
% elif comment_system == 'utterances': | ||
${utterances.comment_form(url, title, identifier)} | ||
%endif | ||
${comments_helper_impl.comment_form(url, title, identifier)} | ||
</%def> | ||
|
||
<%def name="comment_link(link, identifier)"> | ||
%if comment_system == 'disqus': | ||
${disqus.comment_link(link, identifier)} | ||
% elif comment_system == 'intensedebate': | ||
${intensedebate.comment_link(link, identifier)} | ||
% elif comment_system == 'muut': | ||
${muut.comment_link(link, identifier)} | ||
% elif comment_system == 'facebook': | ||
${facebook.comment_link(link, identifier)} | ||
% elif comment_system == 'isso': | ||
${isso.comment_link(link, identifier)} | ||
% elif comment_system == 'commento': | ||
${commento.comment_link(link, identifier)} | ||
% elif comment_system == 'utterances': | ||
${utterances.comment_link(link, identifier)} | ||
%endif | ||
${comments_helper_impl.comment_link(link, identifier)} | ||
</%def> | ||
|
||
<%def name="comment_link_script()"> | ||
%if comment_system == 'disqus': | ||
${disqus.comment_link_script()} | ||
% elif comment_system == 'intensedebate': | ||
${intensedebate.comment_link_script()} | ||
% elif comment_system == 'muut': | ||
${muut.comment_link_script()} | ||
% elif comment_system == 'facebook': | ||
${facebook.comment_link_script()} | ||
% elif comment_system == 'isso': | ||
${isso.comment_link_script()} | ||
% elif comment_system == 'commento': | ||
${commento.comment_link_script()} | ||
% elif comment_system == 'utterances': | ||
${utterances.comment_link_script()} | ||
%endif | ||
${comments_helper_impl.comment_link_script()} | ||
</%def> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.