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

Show liquid warnings. #5129

Merged
merged 1 commit into from Jul 25, 2016

Conversation

Projects
None yet
3 participants
@stevecheckoway
Contributor

stevecheckoway commented Jul 24, 2016

Liquid warnings are not shown (unless liquid's error_mode is set to strict in which case they are errors). This change causes the warnings to be printed as warnings, but does not stop the build.

For example, given the erroneous code

{% for a in b | c %}{% endfor %}

in index.md, the following warning message is displayed

    Liquid Warning: Liquid syntax error (line 13): Expected end_of_string but found pipe in "a in b | c" in index.md

This is identical to the strict case except it says "Liquid Warning" rather than "Liquid Exception".

The line numbers displayed do not count any front matter lines, but this is already true of the exceptions.

@stevecheckoway

This comment has been minimized.

Show comment
Hide comment
@stevecheckoway

stevecheckoway Jul 24, 2016

Contributor

I fixed the overly-long line error. I'm not sure what the other errors are, but I can't reproduce them locally and they don't seem related to this change.

Contributor

stevecheckoway commented Jul 24, 2016

I fixed the overly-long line error. I'm not sure what the other errors are, but I can't reproduce them locally and they don't seem related to this change.

Jekyll.logger.warn "Liquid Warning:",
LiquidRenderer.format_error(e, path || self.path)
end
template.render!(payload, info)
# rubocop: disable RescueException
rescue Exception => e

This comment has been minimized.

@parkr

parkr Jul 24, 2016

Member

We should probably change this to just rescue => e.

@parkr

parkr Jul 24, 2016

Member

We should probably change this to just rescue => e.

@parkr parkr added the enhancement label Jul 24, 2016

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jul 24, 2016

Member

LGTM.

Member

parkr commented Jul 24, 2016

LGTM.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jul 25, 2016

Member

@jekyllbot: merge +minor

Member

parkr commented Jul 25, 2016

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit 810e411 into jekyll:master Jul 25, 2016

1 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
jekyll/lgtm Approved by @parkr. Requires 1 more LGTM.
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jekyllbot added a commit that referenced this pull request Jul 25, 2016

@stevecheckoway stevecheckoway deleted the stevecheckoway:display-liquid-warnings branch Jul 25, 2016

nickcharlton added a commit to nickcharlton/nickcharlton.net that referenced this pull request Dec 6, 2016

Fixes issues with missing code in code blocks.
Jekyll (jekyll/jekyll#5129) added warnings which
were seen after updating to 3.3.1 and this explains why the code was
missing.

delan added a commit to delan/www.azabani.com that referenced this pull request Aug 31, 2018

fix URL corruption under Ruby 2.4+ by migrating to Jekyll 3.8.3
3.7.2 fixes a bug where permalinks that are functions of post dates
aren’t so “perma” between Ruby < 2.4 and Ruby ≥ 2.4 [0], effectively
moving ten posts back to their original paths:

• /2014/01/{03,02}/forcing-single-timezone-jekyll.html
• /2014/01/{03,02}/unicode-support-shootout.html
• /2014/01/{07,06}/falsehoods-programmers-believe-about-names.html
• /2014/01/{08,07}/after-pgp-key-signing-parties.html
• /2014/01/{16,15}/adventures-comssa.org.au-part1.html
• /2014/01/{16,15}/another-world-code-review.html
• /2014/01/{17,16}/adventures-comssa.org.au-part2.html
• /2014/01/{18,17}/jekyll-1.4.3-broken-windows.html
• /2014/01/{27,26}/inception.html
• /2015/08/{07,06}/modern-openbsd-home-router.html

Those posts have lived at the wrong paths for over five months, which
was long enough for the search engines to adjust, and it’s impossible
to know whether or not any backlinks were made in that time, so I’ve
kept the “wrong” paths alive with some <meta> redirects.

I’ve written a Makefile that makes it easy to examine the differences
between the old site and the new site (and catch regressions).

This site was a GitHub Pages site until I moved it to my own server
in 3b09813, but I never bothered to familiarise myself with the
Jekyll release notes [1] (nor Ruby packaging in general), so I just
built it with whatever “gem install jekyll” gave me at the time
(including 2.3.0, 2.4.0, 2.5.3, and most recently 3.0.1).

Stability is one of the principles of the Jekyll philosophy [2], and
the developers have done a pretty good job of living up to that. The
only other changes I’ve made in this commit were to take advantage of
new Jekyll features, fix syntax errors that are no longer silenced,
and iron out some very minor changes to the resultant HTML.

3.2.0 allows some symbolic links that were previously forbidden in
safe mode [3], making update.sh redundant, and reveals some syntax
errors [4] that I can only imagine were allowed by Liquid a long time
ago (or were always wrong but happen to work), so I’ve fixed them:

>     Liquid Warning: Liquid syntax error (line 6): [:end_of_string] is not a valid expression in "page.title !=" in _layouts/default.html
>     Liquid Warning: Liquid syntax error (line 23): [:end_of_string] is not a valid expression in "page.title !=" in _layouts/default.html
>     Liquid Warning: Liquid syntax error (line 2): [:end_of_string] is not a valid expression in "post._link ==" in index.html
>     Liquid Warning: Liquid syntax error (line 2): [:end_of_string] is not a valid expression in "post._link !=" in chain/index.html

3.1.0 changes the heading fragments in about/evaluate/index.md, but
while the new ones are clearly better, a cool URL doesn’t change [5],
so I’ve added some dummy elements to keep the old fragments working.

3.0.0 changes the default highlighter from Pygments.rb to Rouge [6],
complicating the HTML for code blocks and inline code, so I’ve turned
highlighting off to keep the old HTML and eliminate a moving part.

[0] jekyll/jekyll#6697
[1] https://jekyllrb.com/docs/history/
[2] https://jekyllrb.com/philosophy.html
[3] jekyll/jekyll#4710
[4] jekyll/jekyll#5129
[5] https://www.w3.org/Provider/Style/URI
[6] jekyll/jekyll#3323
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment