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

Jekyll 3.0 points out Liquid rendering error in posts.html #141

Closed
jeremymodell opened this issue Apr 4, 2015 · 2 comments
Closed

Jekyll 3.0 points out Liquid rendering error in posts.html #141

jeremymodell opened this issue Apr 4, 2015 · 2 comments

Comments

@jeremymodell
Copy link

Edit: Error fixed, see explanation.
So I upgraded to the newest jekyll beta (3.0 beta 2) and the good news is that most things work, except for a quick fix needed in posts.html. After upgrading while trying to generate the site with build jekyll i encountered a weird error for liquid

 Liquid Exception: Liquid syntax error: Expected dotdot but found id in "(site.owner.disqus-shortname and page.comments) or site.comments" in _layouts/post.html
jekyll 3.0.0.pre.beta2 | Error:  Liquid syntax error: Expected dotdot but found id in "(site.owner.disqus-shortname and page.comments) or site.comments" 

and after looking at _layout/posts.html and searching the issue online it seems that the error always existed, parentheses are not permitted by Liquid but for the first time it will prevent a build of a site because Jekyll 3 will show the error. So to fix the issue we just remove the offending parentheses in the disqus part of of post.html starting at line 39 like so

{% if site.owner.disqus-shortname and page.comments or site.comments %}<span class="entry-comments"><i class="fa fa-comment-o"></i> <a href="#disqus_thread">Comment</a></span>{% endif %}
        {% if page.share %}{% include social-share.html %}{% endif %}
        {% if page.ads == true %}{% include ad-sidebar.html %}<!-- /.google-ads -->{% endif %}
      </footer>
      <div class="entry-content">
        {{ content }}
        {% if site.owner.disqus-shortname and page.comments or site.comments %}
          <div id="disqus_thread"></div><!-- /#disqus_thread -->
          {% include disqus-comments.html %}
@mmistakes
Copy link
Owner

Seems valid. Care to submit a PR so I can test it out. Just want to make sure the Disqus script isn't loading if those conditions aren't met. In the past its mistakenly loaded on pages even when someone hadn't included a shortname in their _config.yml or comments: true in a post.

The bit with the parentheses was submitted as a PR if I recalled correctly to cover cases where someone might want comments to appear on all posts without having to manually add comments: true to them. Seemed to work at the time without errors so I left it alone. Definitely want things to work with the upcoming 3.0 release.

@mmistakes
Copy link
Owner

Should be fixed as of 2.3.2

jessestuart added a commit to jessestuart/jessestuart.com-archived that referenced this issue Apr 11, 2017
* mmistakes/master: (102 commits)
  Improve readability of .scss files
  Change `spin` to `adjust-hue` - Close mmistakes#201
  Update modified date
  Update gems
  removing parentheses, see issue mmistakes#141
  Fix search.js interferace with other forms - cc/ issue mmistakes#194
  Remove Octopress configuration
  Update README
  Remove feed.xml and replace with jekyll-feed gem
  Replace {% highlight %} Jekyll tags with GFM ```
  Remove Octopress dependency
  Update gems
  removed pro tip on applying for twitter cards
  Ignore .less files not files containing "less"
  Sanitize excerpts in search.json - Fixes mmistakes#191
  Normalize auto {{ post.excerpts }} - When excerpt: isn't set in a
post's YAML Front Matter fallback to Jekyll's auto excerpts - Strip
HTML from auto excerpts and MathJax code with Liquid filters applied to
post listings (index.html, /blog/, /articles/)
  Support Jekyll 3.0 - Update to Jekyll v3.0 - Switch from Pygments.rb
to Rouge for syntax highlighting - Include jekyll-gist gem - Update
theme documentation
  Fix typo in `bundle exec`
  Update dependencies
  Update links - Remove Made Mistakes from header nav - Update So
Simple footer link
  ...

# Conflicts:
#	_config.yml
#	_data/authors.yml
#	_data/navigation.yml
#	_includes/footer.html
#	_layouts/page.html
#	_layouts/post.html
#	_posts/articles/2011-03-10-sample-post.md
#	_posts/articles/2012-05-22-readability-post.md
#	_posts/articles/2013-05-22-sample-post-images.md
#	_posts/articles/2013-05-23-readability-feature-post.md
#	_posts/articles/2013-06-25-video-post.md
#	_posts/articles/2013-08-16-code-highlighting-post.md
#	_posts/articles/2014-06-19-author-override.md
#	_posts/blog/2014-08-08-hello-world.md
#	about/index.md
#	feed.xml
#	images/michael-rose-photo.jpg
#	images/so-simple-sample-image-1.jpg
#	images/so-simple-sample-image-2.jpg
#	images/so-simple-sample-image-3.jpg
#	images/so-simple-sample-image-4.jpg
#	images/so-simple-sample-image-5.jpg
#	images/so-simple-sample-image-6.jpg
#	images/so-simple-sample-image-7.jpg
#	theme-setup/index.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants