-
Notifications
You must be signed in to change notification settings - Fork 288
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 using :xxx_name in autopage titles (fixes #225). #240
base: master
Are you sure you want to change the base?
Conversation
|
||
return expand_placeholders(toFormat, { | ||
":cat" => Jekyll::Utils.slugify(category.to_s, mode:slugify_mode, cased:slugify_cased), | ||
":cat_name" => category_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should call slugify to avoid invalid characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the :cat_name expansion? The whole point is to be able to return the category name without being mangled - what characters are "invalid" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just gave this a bit of a try with the category Tes<tin>g&"
and it comes out in the page as follows:
<title>Posts in category Tesg&" | ...</title>
<meta property="og:title" content="Posts in category Tesg&"" />
So quotes and ampersands are handled correctly, but anything between angle brackets is stripped out...
This is the same behaviour I get if I try putting angle brackets in a plain page title, e.g:
title: 'foo"<bar>baz'
in the page front matter comes out as:
<title>foo"baz | ...</title>
An unmatched bracket in either (e.g. foo<bar
) comes out correctly (foo<bar
).
Any idea if this is a limitation/bug within Jekyll itself? Either way, it seems to be doing the right thing.
return expand_placeholders(toFormat, { | ||
":coll" => Jekyll::Utils.slugify(collection.to_s, mode:slugify_mode, cased:slugify_cased), | ||
":coll_name" => collection_name, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this and other lines in this file, call slugify
No description provided.