Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to select the comments provider #493

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hszhakka
Copy link
Contributor

@hszhakka hszhakka commented Mar 1, 2020

The users can select their comments provider by configuring:

minima:
  comments_provider: # Configure the comments provider here (default: disqus)

For example, if the comments provider is discourse, the user needs to create a file _includes/discourse_comments.html and put all script code of discourse into that file.

@DirtyF
Copy link
Member

DirtyF commented Apr 10, 2020

What comment providers can we list here? Do they all implement the same as Disqus?

{%- if site.disqus.shortname -%}
{%- include disqus_comments.html -%}
{%- endif -%}
{% if page.comments != false and jekyll.environment == "production" %}
Copy link

@MichaelCurrin MichaelCurrin May 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you get the value and it is not set on the page, it will be null and then null != false will be truthy.

---
---
{{ page.fizz | jsonify }}

Result is null

So while page.comments != false is unreliable, then page.comments == true will only be truthy if the value is true and not if it is false or missing.

Suggested change
{% if page.comments != false and jekyll.environment == "production" %}
{% if page.comments == true and jekyll.environment == "production" %}

OR

  {% if page.comments and page.comments == true and jekyll.environment == "production" %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants