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

Projects
None yet
5 participants
@mpchadwick
Contributor

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

This comment has been minimized.

Member

pathawks commented Nov 17, 2017

@DirtyF DirtyF requested a review from jekyll/plugin-core Mar 8, 2018

@DirtyF

DirtyF approved these changes Mar 8, 2018

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"]

This comment has been minimized.

@benbalter

benbalter Mar 8, 2018

Collaborator

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

DirtyF added some commits Mar 8, 2018

@DirtyF

This comment has been minimized.

Member

DirtyF commented Mar 8, 2018

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit ead4375 into jekyll:master Mar 8, 2018

2 checks passed

WIP ready for review
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jekyllbot added a commit that referenced this pull request Mar 8, 2018

@DirtyF

This comment has been minimized.

Member

DirtyF commented Mar 8, 2018

Thanks @mpchadwick 😃


if page_number
return page_number + @title
end

This comment has been minimized.

@pathawks

pathawks Mar 8, 2018

Member

Is it intentional that we are not memoizing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment