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

Include page number in title #250

Merged
merged 3 commits into from
Mar 8, 2018

Conversation

mpchadwick
Copy link
Contributor

@mpchadwick mpchadwick commented Nov 17, 2017

Per Moz's article "Pagination: Best Practices for SEO & User Experience" it's not ideal to use the same title with pagination. This change follows Moz's suggestion and appends "Page X of Y for" to the beginning of the <title> when on page 2 of deeper.

@pathawks
Copy link
Member

/cc: @jekyll/ecosystem

@DirtyF DirtyF requested a review from a team March 8, 2018 15:35
Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

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

Fine by me. Thanks @mpchadwick

@@ -175,6 +181,17 @@ def homepage_or_about?
page["url"] =~ HOMEPAGE_OR_ABOUT_REGEX
end

def page_number
return if !@context["paginator"] || !@context["paginator"]["page"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd write this as return unless @context["paginator"] && @context["paginator"]["page"] to make the intent a bit more clear.

@DirtyF
Copy link
Member

DirtyF commented Mar 8, 2018

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit ead4375 into jekyll:master Mar 8, 2018
jekyllbot added a commit that referenced this pull request Mar 8, 2018
@DirtyF
Copy link
Member

DirtyF commented Mar 8, 2018

Thanks @mpchadwick 😃


if page_number
return page_number + @title
end
Copy link
Member

Choose a reason for hiding this comment

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

Is it intentional that we are not memoizing this?

@chesterhow
Copy link

Is there a way to disable this feature?

@jekyll jekyll locked and limited conversation to collaborators Apr 13, 2020
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.

6 participants