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

Tweak page description #2982

Merged
merged 2 commits into from
Oct 8, 2014
Merged

Tweak page description #2982

merged 2 commits into from
Oct 8, 2014

Conversation

XhmikosR
Copy link
Contributor

@XhmikosR XhmikosR commented Oct 8, 2014

  1. remove unneeded end tags
  2. add strip_newlines in description (without this, I ended up with newlines inside the quotes)
  3. move X-UA-Compatible right after meta charset

Remove unneeded end tag, and also strip newlines.
Move `X-UA-Compatible` just after `meta charset`.
@nternetinspired
Copy link
Contributor

Good call, strip_newlines is a good addition.

@@ -7,7 +7,7 @@ layout: null
<title>{{ site.title | xml_escape }}</title>
<description>{{ site.description | xml_escape }}</description>
<link>{{ site.url }}{{ site.baseurl }}/</link>
<atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml" />
<atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/>
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unneeded space before the end tag.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, do you think it helps at all for readability? I find it more readable with the space than without, but it could be just me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To me it's the same, plus this is the only place with a space before the end tag.

@parkr
Copy link
Member

parkr commented Oct 8, 2014

Cool, looking good.

@parkr parkr self-assigned this Oct 8, 2014
parkr added a commit that referenced this pull request Oct 8, 2014
@parkr parkr merged commit 70174e8 into jekyll:master Oct 8, 2014
parkr added a commit that referenced this pull request Oct 8, 2014
@XhmikosR XhmikosR deleted the page-description branch October 8, 2014 21:00
@amw
Copy link

amw commented May 9, 2016

strip_newlines removes the "\n" characters instead of replacing them with spaces. This creates word run-ins in markdown content. Source:

This is an example paragraph
that is broken into a few
lines. New lines render as
spaces in HTML.

This is rendered as This is an example paragraphthat is broken into a fewlines. New lines render asspaces in HTML in the meta tag.

I reproduced this on a brand new jekyll site by adding this as the first paragraph to the "welcome-to-jekyll.markdown" post.

I think the solution is to either keep the newlines inside the description meta tag or replace it with a custom liquid filter like this one:

  def newlines_to_spaces input
    input.to_s.gsub(/\r?\n/, ' '.freeze)
  end

@amw
Copy link

amw commented May 9, 2016

I've opened a new issue since this PR has been closed for so long.

@jekyll jekyll locked and limited conversation to collaborators Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants