-
Notifications
You must be signed in to change notification settings - Fork 293
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
Conversation
/cc: @jekyll/ecosystem |
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.
Fine by me. Thanks @mpchadwick
lib/jekyll-seo-tag/drop.rb
Outdated
@@ -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"] |
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'd write this as return unless @context["paginator"] && @context["paginator"]["page"]
to make the intent a bit more clear.
@jekyllbot: merge +minor |
Thanks @mpchadwick 😃 |
|
||
if page_number | ||
return page_number + @title | ||
end |
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.
Is it intentional that we are not memoizing this?
Is there a way to disable this feature? |
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.