parentheses can be used in Liquid?
I met a Liquid Warning: Liquid syntax error (line 47): Expected dotdot but found pipe in "{{ page.slug | default: (page.title | slugify) }}". I guess this is generated by:
https://github.com/damieng/jekyll-blog-comments/blob/389b1aed610a82c60c27f1db63fd67ae56cabe63/jekyll/_includes/comments.html#L1
Hmm, that line works perfectly here on Jekyll 3.9.0 - what version are you using?
$ jekyll -v
jekyll 4.2.0
I just upgraded my personal blog from Jekyll 3.9 to 4.2.0 in order to try and repo this and I'm still not seeing an error or warning.
Here's my full version of comments.html from my blog if you want to try a slight alteration but I'm struggling to see how it would be different:
{% if site.comments.enabled %}
{% capture default_slug %}{{ page.slug | default: (page.title | slugify) }}{% endcapture %}
{% capture slug %}{{ (page.slug | fallback: default_slug) | downcase }}{% endcapture %}
{% assign comments_map = site.data.comments[slug] %}
{% assign comments = site.emptyArray %}
{% for comment in comments_map %}
{% assign comments = comments | push: comment[1] %}
{% endfor %}
{% assign comment_count = site.data.comments[slug] | size %}
{% if comment_count > 0 or page.commenting == 'open' %}
{% assign author = site.authors[page.author] %}
<div id="comments">
<h3>{% if comment_count == 0 %}No responses yet{% else %}{{ comment_count }} responses{% endif %}</h3>
<ol>
{% if comment_count > 0 %}
{% assign sorted_comments = comments | sort: 'date' %}
{% for comment in sorted_comments %}
<li id="comment-{{ comment.id }}"{% if comment.email == author.email %} class="byauthor" {% endif %}>
{% include comment.html %}
</li>
{% endfor %}
{% endif %}
{% if page.commenting == 'open' %}
<li>
{% include comment-new.html %}
</li>
{% endif %}
</ol>
</div>
{% endif %}
{% endif %}
Okay, I checked the warning, and find that is not the warning about 'comment.html'. it is from my /_post/2021-07-09-texttitle.md.
in that file I posted a code patch:
{% capture default_slug %}{{ page.slug | default: (page.title | slugify) }}{% endcapture %}
and jekyll trys to compile that code. I don't know how to disable jekyll to compile/parse the code patch in my markdown posts.
Any ideas will be appeciated!! Thanks!!
By the way, have you had any new ideas about this issue ? https://github.com/Azure-Functions/jekyll-blog-comments/issues/16
Wrapping it in {%raw%} and {%endraw%} should help!
e.g.
{%raw%}{% capture default_slug %}{{ page.slug | default: (page.title | slugify) }}{% endcapture %}{%endraw%}
Many thanks !!!
No problem. Glad you're up and running.
but how about this issue ;-D? Azure-Functions/jekyll-blog-comments#16