Include page number in title (#250)

Merge pull request 250
This commit is contained in:
Max Chadwick 2018-03-08 12:04:41 -05:00 committed by jekyllbot
parent 3ce93abce7
commit ead4375415
1 changed files with 17 additions and 0 deletions

View File

@ -53,6 +53,12 @@ module Jekyll
page_title || site_title
end
end
if page_number
return page_number + @title
end
@title
end
def name
@ -175,6 +181,17 @@ module Jekyll
page["url"] =~ HOMEPAGE_OR_ABOUT_REGEX
end
def page_number
return unless @context["paginator"] && @context["paginator"]["page"]
current = @context["paginator"]["page"]
total = @context["paginator"]["total_pages"]
if current > 1
return "Page #{current} of #{total} for "
end
end
attr_reader :context
def fallback_data