pax_global_header 0000666 0000000 0000000 00000000064 13617374403 0014522 g ustar 00root root 0000000 0000000 52 comment=53ea42fee99862fa24d47fdef0834841e7c5ac10
jekyll-paginate-v2-3.0.0/ 0000775 0000000 0000000 00000000000 13617374403 0015127 5 ustar 00root root 0000000 0000000 jekyll-paginate-v2-3.0.0/.codeclimate.yml 0000664 0000000 0000000 00000000577 13617374403 0020212 0 ustar 00root root 0000000 0000000 ---
engines:
duplication:
enabled: true
checks:
Similar code:
enabled: false
config:
languages:
- ruby
fixme:
enabled: true
rubocop:
enabled: true
checks:
Rubocop/Metrics/MethodLength:
enabled: false
Rubocop/Metrics/ParameterLists:
enabled: false
ratings:
paths:
- "**.rb"
exclude_paths:
- spec/ jekyll-paginate-v2-3.0.0/.gitignore 0000664 0000000 0000000 00000000300 13617374403 0017110 0 ustar 00root root 0000000 0000000 *.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
spec/dest
tmp
_site/
.sass-cache
.jekyll-metadata
.gitignore
vendor/ jekyll-paginate-v2-3.0.0/.rubocop.yml 0000664 0000000 0000000 00000000102 13617374403 0017372 0 ustar 00root root 0000000 0000000 inherit_from: .rubocop_todo.yml
Style/For:
EnforcedStyle: each
jekyll-paginate-v2-3.0.0/.rubocop_todo.yml 0000664 0000000 0000000 00000044214 13617374403 0020433 0 ustar 00root root 0000000 0000000 # This configuration was generated by `rubocop --auto-gen-config`
# on 2017-11-29 09:00:00 +0030 using RuboCop version 0.51.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
# Include: **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'examples/01-typicalblog/Gemfile'
- 'examples/02-category/Gemfile'
- 'examples/03-tags/Gemfile'
- 'examples/04-jsonapi/Gemfile'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
Exclude:
- 'jekyll-paginate-v2.gemspec'
# Offense count: 29
# Cop supports --auto-correct.
# Configuration parameters: EnforcedHashRocketStyle, SupportedHashRocketStyles, EnforcedColonStyle, SupportedColonStyles, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/AlignHash:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/defaults.rb'
- 'lib/jekyll-paginate-v2/generator/defaults.rb'
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
# Offense count: 3
# Cop supports --auto-correct.
Layout/CommentIndentation:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLineAfterMagicComment:
Exclude:
- 'jekyll-paginate-v2.gemspec'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 3
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/autoPages.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'spec/generator/utils_spec.rb'
# Offense count: 11
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/autoPages.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'spec/generator/defaults_spec.rb'
- 'spec/generator/paginationPage_spec.rb'
- 'spec/generator/paginator_spec.rb'
- 'spec/generator/utils_spec.rb'
# Offense count: 11
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Layout/EmptyLinesAroundClassBody:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/pages/categoryAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/collectionAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/tagAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/compatibilityUtils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
# Offense count: 6
# Cop supports --auto-correct.
Layout/EmptyLinesAroundMethodBody:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/pages/categoryAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/collectionAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/tagAutoPage.rb'
- 'lib/jekyll-paginate-v2/generator/compatibilityUtils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 19
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: native, lf, crlf
Layout/EndOfLine:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'jekyll-paginate-v2.gemspec'
- 'lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/IndentHash:
Exclude:
- 'lib/jekyll-paginate-v2/generator/defaults.rb'
# Offense count: 38
# Cop supports --auto-correct.
Layout/LeadingCommentSpace:
Exclude:
- 'Rakefile'
- 'lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/categoryAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/collectionAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/tagAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/compatibilityUtils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/paginationPage.rb'
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/MultilineOperationIndentation:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 183
# Cop supports --auto-correct.
Layout/SpaceAfterComma:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/autoPages.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'spec/generator/paginator_spec.rb'
# Offense count: 22
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleInsidePipes, SupportedStylesInsidePipes.
# SupportedStylesInsidePipes: space, no_space
Layout/SpaceAroundBlockParameters:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/autoPages.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/categoryAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/collectionAutoPage.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/tagAutoPage.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles.
# SupportedStyles: space, no_space
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
# Offense count: 21
# Cop supports --auto-correct.
Layout/SpaceAroundKeyword:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/paginationPage.rb'
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
# Offense count: 14
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceAroundOperators:
Exclude:
- 'jekyll-paginate-v2.gemspec'
- 'lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'spec/generator/utils_spec.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, SupportedStylesForEmptyBraces.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceBeforeBlockBraces:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideBlockBraces:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb'
- 'lib/jekyll-paginate-v2/generator/paginationPage.rb'
- 'spec/generator/utils_spec.rb'
# Offense count: 85
# Cop supports --auto-correct.
Layout/SpaceInsideParens:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/autoPages.rb'
- 'lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb'
- 'lib/jekyll-paginate-v2/generator/compatibilityUtils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/paginationPage.rb'
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
- 'spec/generator/utils_spec.rb'
# Offense count: 20
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingBlankLines:
Enabled: false
# Offense count: 86
# Cop supports --auto-correct.
Layout/TrailingWhitespace:
Enabled: false
# Offense count: 1
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 1
Lint/DuplicateMethods:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
# Offense count: 3
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/autoPages.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 14
Lint/UselessAssignment:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'spec/generator/paginator_spec.rb'
# Offense count: 10
Metrics/AbcSize:
Max: 165
# Offense count: 3
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 91
# Offense count: 4
# Configuration parameters: CountBlocks.
Metrics/BlockNesting:
Max: 5
# Offense count: 5
Metrics/CyclomaticComplexity:
Max: 26
# Offense count: 183
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 389
# Offense count: 8
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 92
# Offense count: 10
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 9
# Offense count: 5
Metrics/PerceivedComplexity:
Max: 30
# Offense count: 1
Naming/AccessorMethodName:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationPage.rb'
# Offense count: 8
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
# Offense count: 74
Style/CommentedKeyword:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 1
Style/DateTime:
Exclude:
- 'jekyll-paginate-v2.gemspec'
# Offense count: 13
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: for, each
Style/For:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
# Offense count: 29
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: when_needed, always, never
Style/FrozenStringLiteralComment:
Enabled: false
# Offense count: 1
Style/IfInsideElse:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationPage.rb'
# Offense count: 4
# Cop supports --auto-correct.
Style/LineEndConcatenation:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 1
Style/MultilineBlockChain:
Exclude:
- 'lib/jekyll-paginate-v2/generator/compatibilityUtils.rb'
# Offense count: 3
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/defaults.rb'
- 'lib/jekyll-paginate-v2/generator/defaults.rb'
- 'lib/jekyll-paginate-v2/version.rb'
# Offense count: 17
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: both, prefix, postfix
Style/NegatedIf:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/autoPages.rb'
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
# Offense count: 1
Style/NestedTernaryOperator:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
# SupportedStyles: skip_modifier_ifs, always
Style/Next:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'jekyll-paginate-v2.gemspec'
# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: short, verbose
Style/PreferredHashMethods:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
- 'lib/jekyll-paginate-v2/generator/paginationPage.rb'
- 'lib/jekyll-paginate-v2/generator/utils.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
Exclude:
- 'lib/jekyll-paginate-v2/generator/compatibilityUtils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantException:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 3
# Cop supports --auto-correct.
Style/SelfAssignment:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
# Offense count: 241
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInLiteral:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/defaults.rb'
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
# Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
Style/TrivialAccessors:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginator.rb'
# Offense count: 5
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/jekyll-paginate-v2/generator/paginationGenerator.rb'
- 'lib/jekyll-paginate-v2/generator/paginationModel.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/UnneededPercentQ:
Exclude:
- 'jekyll-paginate-v2.gemspec'
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, MinSize, WordRegex.
# SupportedStyles: percent, brackets
Style/WordArray:
EnforcedStyle: brackets
# Offense count: 2
# Cop supports --auto-correct.
Style/ZeroLengthPredicate:
Exclude:
- 'lib/jekyll-paginate-v2/autopages/utils.rb'
- 'lib/jekyll-paginate-v2/generator/paginationIndexer.rb'
jekyll-paginate-v2-3.0.0/.travis.yml 0000664 0000000 0000000 00000000404 13617374403 0017236 0 ustar 00root root 0000000 0000000 language: ruby
cache: bundler
sudo: false
rvm:
- 2.2
before_install:
- rm -rf .bundle/
- rm -rf vendor/cache/
- rm -rf Gemfile.lock
before_script: bundle update
#script: script/cibuild
notifications:
email:
on_success: never
on_failure: never jekyll-paginate-v2-3.0.0/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000006561 13617374403 0017736 0 ustar 00root root 0000000 0000000 # Contributor Covenant Code of Conduct
> āBe kind,
>
> for everyone you meet is fighting a harder battle.ā
>
> --Plato
## TL;DR
Try to be the best version of yourself and to be excellent to others.
:purple_heart:
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [jekyll@sverrirs.com](mailto:jekyll@sverrirs.com). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/ jekyll-paginate-v2-3.0.0/Gemfile 0000664 0000000 0000000 00000000541 13617374403 0016422 0 ustar 00root root 0000000 0000000 source 'https://rubygems.org'
# Specify your gem's dependencies in jekyll-paginate-v2.gemspec
gemspec
if ENV["JEKYLL_VERSION"]
gem "jekyll", "~> #{ENV["JEKYLL_VERSION"]}"
end
# adding dev-dependencies to Gemfile (instead of gemspec) allows calling
# `bundle exec [executable] [options]` more easily.
group :test do
gem "rubocop", "~> 0.51.0"
end
jekyll-paginate-v2-3.0.0/LICENSE 0000664 0000000 0000000 00000002100 13617374403 0016125 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 2016 Sverrir Sigmundarson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
jekyll-paginate-v2-3.0.0/README-AUTOPAGES.md 0000664 0000000 0000000 00000012627 13617374403 0017744 0 ustar 00root root 0000000 0000000 # Jekyll::Paginate V2::AutoPages
**AutoPages** are an optional pagination addon that can automatically generate paginated pages for all your collections, tags and categories used in the pages on your site. This is useful if you have a large site where paginating the contents of your collections, tags or category lists provides a better user experience.
> This feature is based on [code](https://github.com/stevecrozz/lithostech.com/blob/master/_plugins/tag_indexes.rb) written and graciously donated by [Stephen Crosby](https://github.com/stevecrozz). Thanks! :)
* [Site configuration](#site-configuration)
* [Simple configuration](#simple-configuration)
+ [Obtaining the original Tag or Category name](#obtaining-the-original-tag-or-category-name)
* [Advanced configuration](#advanced-configuration)
* [Specialised pages](#specialised-pages)
* [Considerations](#considerations)
+ [Title should not contain pagination macros](#title-should-not-contain-pagination-macros)
* [Example Sites](https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples)
* [Common issues](#common-issues)
:warning: Please note, this feature is still **experimental** and might not be ready for production yet.
## Site configuration
``` yml
############################################################
# Site configuration for the Auto-Pages feature
# The values here represent the defaults if nothing is set
autopages:
# Site-wide kill switch, disable here and it doesn't run at all
enabled: false
# Category pages, omit entire config element to disable
categories:
# Optional, the list of layouts that should be processed for every category found in the site
layouts:
- 'autopage_category.html'
# Optional, the title that each category paginate page should get (:cat is replaced by the Category name)
title: 'Posts in category :cat'
# Optional, the permalink for the pagination page (:cat is replaced),
# the pagination permalink path is then appended to this permalink structure
permalink: '/category/:cat'
# Collection pages, omit to disable
collections:
layouts:
- 'autopage_collection.html'
title: 'Posts in collection :coll' # :coll is replaced by the collection name
permalink: '/collection/:coll'
# Tag pages, omit to disable
tags:
layouts:
- 'autopage_tags.html'
title: 'Posts tagged with :tag' # :tag is replaced by the tag name
permalink: '/tag/:tag'
```
## Simple configuration
The only thing needed to enable the auto pages is to add the configuration element to the site.config file and then create a layout that the pages should use.
Example of a simple autopage layout can be seen in Example 3 [examples/03-tags/_layouts/autopage_tags.html](https://github.com/sverrirs/jekyll-paginate-v2/blob/master/examples/03-tags/_layouts/autopage_tags.html).
The layout does not need anything special beyond the normal pagination logic (e.g. `for post in paginator.posts` and then the next/prev arrows). You can either name the layouts by the default names (see site configuration section above) or give them a custom name and add them to the `layouts:` configuration for the relevant type of autopage.
### Obtaining the original Tag or Category name
Internally the autopage system will trim and downcase the indexing key (tag, category or collection name). To retrieve the original name of the index key you can use the `autopages.display_name` liquid variable.
``` html
All pages tagged with {% if page.autopages %}{{page.autopages.display_name}}{% endif %}
```
This variable returns the untouched key value. As an example if your site uses the tag `Science-Fiction` then
```
page.tag = "science-fiction"
page.autopages.display_name = "Science-Fiction"
```
See [#6](https://github.com/sverrirs/jekyll-paginate-v2/issues/6) for more information.
## Advanced configuration
You can customize the look an feel of the permalink structure and the title for the auto-pages. You can also add front-matter `pagination` configuration to the layout pages you're using to specify things like sorting, filtering and all the other configuration options that are available in the normal pagination generator.
> Keep in mind that when the autopages are paginated the pagination permalink structure and pagination title suffix is appended to them.
## Specialised pages
Special autopages can be used that leverage the powerful filtering and sorting features of the pagination logic. For example you might want to create special pages autopages that paginate all tags in a certain collection or certain tags within a category.
To achieve this you specify the `pagination` front-matter configuration in the autopage layout file.
An example of this can be found in [examples/03-tags/_layouts/autopage_collections_tags.html](https://github.com/sverrirs/jekyll-paginate-v2/blob/master/examples/03-tags/_layouts/autopage_collections_tags.html). This page creates paginated pages for all tags that are found in the special _all_ collections.
## Considerations
### Title should not contain pagination macros
There is no need to include the pagination title macros `:num`, `:max` or `:title` in the title configuration. The autopages will use the title configuration from the pagination configuration itself.
## Common issues
_None reported so far_ jekyll-paginate-v2-3.0.0/README-GENERATOR.md 0000664 0000000 0000000 00000060251 13617374403 0017736 0 ustar 00root root 0000000 0000000 # Jekyll::Paginate V2::Generator
The **Generator** forms the core of the pagination logic. It is responsible for reading the posts and collections in your site and split them correctly across multiple pages according to the supplied configuration. It also performs the necessary functions to link to the previous and next pages in the page-sets that it generates.
> The code was based on the original design of [jekyll-paginate](https://github.com/jekyll/jekyll-paginate) and features were sourced from discussions such as [#27](https://github.com/jekyll/jekyll-paginate/issues/27) (thanks [Günter Kits](https://github.com/gynter)).
* [Site configuration](#site-configuration)
* [Page configuration](#page-configuration)
* [Backwards compatibility](#backwards-compatibility-with-jekyll-paginate)
* [Example Sites](https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples)
* [Paginating collections](#paginating-collections)
+ [Single collection](#paginating-a-single-collection)
+ [Multiple collection](#paginating-multiple-collections)
+ [The special 'all' collection](#the-special-all-collection)
* [How to paginate categories, tags, locales](#paginate-categories-tags-locales)
+ [Filtering categories](#filtering-categories)
+ [Filtering tags](#filtering-tags)
+ [Filtering locales](#filtering-locales)
* [How to paginate on combination of filters](#paginate-on-combination-of-filters)
* [Overriding site configuration](#configuration-overrides)
* [Offsetting posts (how to skip newest posts)](#offsetting-posts)
* [Advanced Sorting](#advanced-sorting)
* [Creating Pagination Trails](#creating-pagination-trails)
* [How to detect auto-generated pages](#detecting-generated-pagination-pages)
* [Formatting page titles](#formatting-page-titles)
* [Reading pagination meta information](#reading-pagination-meta-information)
* [How to generate a JSON API](#generating-a-json-api)
* [Renaming pagination file names](#renaming-pagination-file-names)
* [Common issues](#common-issues)
- [Dependency Error after installing](#i-keep-getting-a-dependency-error-when-running-jekyll-serve-after-installing-this-gem)
- [Bundler error upgrading gem (Bundler::GemNotFound)](#im-getting-a-bundler-error-after-upgrading-the-gem-bundlergemnotfound)
- [Bundler error running gem (Gem::LoadError)](#im-getting-a-bundler-error-after-upgrading-the-gem-gemloaderror)
- [Pagination pages are not found](#my-pagination-pages-are-not-being-found-couldnt-find-any-pagination-page-skipping-pagination)
- [Categories cause excess folder nesting](#my-pages-are-being-nested-multiple-levels-deep)
- [Pagination pages overwriting each others pages](#my-pagination-pages-are-overwriting-each-others-pages)
## Site configuration
The pagination gem is configured in the site's `_config.yml` file by including the `pagination` configuration element
``` yml
############################################################
# Site configuration for the Jekyll 3 Pagination Gem
# The values here represent the defaults if nothing is set
pagination:
# Site-wide kill switch, disabled here it doesn't run at all
enabled: true
# Set to 'true' to enable pagination debugging. This can be enabled in the site config or only for individual pagination pages
debug: false
# The default document collection to paginate if nothing is specified ('posts' is default)
collection: 'posts'
# How many objects per paginated page, used to be `paginate` (default: 0, means all)
per_page: 10
# The permalink structure for the paginated pages (this can be any level deep)
permalink: '/page/:num/' # Pages are index.html inside this folder (default)
#permalink: '/page/:num.html' # Pages are simple html files
#permalink: '/page/:num' # Pages are html files, linked jekyll extensionless permalink style.
# Optional the title format for the paginated pages (supports :title for original page title, :num for pagination page number, :max for total number of pages)
title: ':title - page :num'
# Limit how many pagenated pages to create (default: 0, means all)
limit: 0
# Optional, defines the field that the posts should be sorted on (omit to default to 'date')
sort_field: 'date'
# Optional, sorts the posts in reverse order (omit to default decending or sort_reverse: true)
sort_reverse: true
# Optional, the default category to use, omit or just leave this as 'posts' to get a backwards-compatible behavior (all posts)
category: 'posts'
# Optional, the default tag to use, omit to disable
tag: ''
# Optional, the default locale to use, omit to disable (depends on a field 'locale' to be specified in the posts,
# in reality this can be any value, suggested are the Microsoft locale-codes (e.g. en_US, en_GB) or simply the ISO-639 language code )
locale: ''
# Optional,omit or set both before and after to zero to disable.
# Controls how the pagination trail for the paginated pages look like.
trail:
before: 2
after: 2
# Optional, the default file extension for generated pages (e.g html, json, xml).
# Internally this is set to html by default
extension: html
# Optional, the default name of the index file for generated pages (e.g. 'index.html')
# Without file extension
indexpage: 'index'
############################################################
```
Also ensure that you remove the old 'jekyll-paginate' gem from your `gems` list and add this new gem instead
``` yml
gems: [jekyll-paginate-v2]
```
## Page configuration
To enable pagination on a page then simply include the minimal pagination configuration in the page front-matter:
``` yml
---
layout: page
pagination:
enabled: true
---
```
Then you can use the normal `paginator.posts` logic to iterate through the posts.
``` html
{% for post in paginator.posts %}
{{ post.title }}
{% endfor %}
```
And to display pagination links, simply
``` html
{% if paginator.total_pages > 1 %}
{% if paginator.previous_page %}
-
Newer
{% endif %}
{% if paginator.next_page %}
-
Older
{% endif %}
{% endif %}
```
> All posts that have the `hidden: true` in their front matter are ignored by the pagination logic.
Following fields area available on the `paginator` object
| Field | Description |
| --- | --- |
| per_page | Maximum number of posts or documents on each pagination page. |
| posts | The list of post objects that belong to this pagination page. |
| total_posts | Total number of posts included in pagination. |
| total_pages | Total number of pagination pages created. |
| page | Number of the current pagination page. |
| page_path | The relative Url path of the current pagination page. |
| previous_page | Number of the previous page in the pagination. Nil if no previous page is available. |
| previous_page_path | The relative Url of the previous page. Nil if no previous page is available. |
| next_page | Number of the next page in the pagination. Nil if there is no next page available. |
| next_page_path | The relative Url of the next page in the pagination. Nil if there is no next page available. |
| first_page | Number of the first page in the pagination (usually this is `1`). |
| first_page_path | The relative Url of the first page in the pagination. |
| last_page | Number of the last page in the pagination (this is equal to `total_pages`). |
| last_page_path | The relative Url of the last page in the pagination. |
| page_trail | The [pagination trail](#creating-pagination-trails) structure |
The code is fully backwards compatible and you will have access to all the normal paginator variables defined in the [official jekyll documentation](https://jekyllrb.com/docs/pagination/#liquid-attributes-available).
Neat! :ok_hand:
Don't delay, go see the [Examples](https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples), they're way more useful than read-me docs at this point :)
## Backwards compatibility with jekyll-paginate
This gem is fully backwards compatible with the old [jekyll-paginate](https://github.com/jekyll/jekyll-paginate) gem and can be used as a zero-configuration replacement for it. If the old site config is detected then the gem will fall back to the old logic of pagination.
> You cannot run both the new pagination logic and the old one at the same time
The following `_config.yml` settings are honored when running this gem in compatability mode
``` yml
paginate: 8
paginate_path: "/legacy/page:num/"
```
See more about the old style of pagination at the [jekyll-paginate](https://github.com/jekyll/jekyll-paginate) page.
> :bangbang: **Warning** Backwards compatibility with the old jekyll-paginate gem is currently scheduled to be removed after **1st January 2018**. Users will start receiving warning log messages when running jekyll two months before this date.
## Paginating collections
By default the pagination system only paginates `posts`. If you only have `posts` and `pages` in your site you don't need to worry about a thing, everything will work as intended without you configuring anything.
However if you use document collections, or would like to, then this pagination gem offers extensive support for paginating documents in one or more collections at the same time.
> Collections are groups of documents that belong together but should not be grouped by date.
> See more about ['collections'](http://ben.balter.com/2015/02/20/jekyll-collections/) on Ben Balters blog.
### Paginating a single collection
Lets expand on Ben's collection discussion (linked above). Let's say that you have hundreds of cupcake pages in your cupcake collection. To create a pagination page for only documents from the cupcake collection you would do this
``` yml
---
layout: page
title: All Cupcakes
pagination:
enabled: true
collection: cupcakes
---
```
### Paginating multiple collections
Lets say that you want to create a single pagination page for only small cakes on your page (you have both cupcakes and cookies to sell). You could do that like this
``` yml
---
layout: page
title: Lil'bits
pagination:
enabled: true
collection: cupcakes, cookies
---
```
### The special 'all' collection
Now your site has grown and you have multiple cake collections on it and you want to have a single page that paginates all of your collections at the same time.
You can use the special `all` collection name for this.
``` yml
---
layout: page
title: All the Cakes!
pagination:
enabled: true
collection: all
---
```
> Note: Due to the `all` keyword being reserved for this feature, you cannot have a collection called `all` in your site configuration. Sorry.
## Paginate categories, tags, locales
Enabling pagination for specific categories, tags or locales is as simple as adding values to the pagination page front-matter and corresponding values in the posts.
### Filtering categories
Filter single category 'software'
``` yml
---
layout: post
pagination:
enabled: true
category: software
---
```
Filter multiple categories (lists only posts belonging to all categories)
``` yml
pagination:
enabled: true
category: software, ruby
```
> To define categories you can either specify them in the front-matter or through the [directory structure](http://jekyllrb.com/docs/variables/#page-variables) of your jekyll site (Categories are derived from the directory structure above the \_posts directory). You can actually use both approaches to assign your pages to multiple categories.
### Filtering tags
Filter on a single tag
``` yml
pagination:
enabled: true
tag: cool
```
Filter on multiple tags
``` yml
pagination:
enabled: true
tag: cool, life
```
> When specifying tags in your posts make sure that the values are not enclosed in single quotes (double quotes are fine). If they are you will get a cryptic error when generating your site that looks like _"Error: could not read file : did not find expected key while parsing a block mapping at line 2 column 1"_
### Filtering locales
In the case your site offers multiple languages you can include a `locale` item in your post front matter. The paginator can then use this value to filter on
The category page front-matter would look like this
``` yml
pagination:
enabled: true
locale: en_US
```
Then for the relevant posts, include the `locale` variable in their front-matter
``` yml
locale: en_US
```
## Paginate on combination of filters
Including only posts from categories 'ruby' and 'software' written in English
``` yml
pagination:
enabled: true
category: software, ruby
locale: en_US, en_GB, en_WW
```
Only showing posts tagged with 'cool' and in category 'cars'
``` yml
pagination:
enabled: true
category: cars
tag: cool
```
... and so on and so on
## Configuration overrides
All of the configuration elements from the `_config.yml` file can be overwritten in the pagination pages. E.g. if you want one category page to have different permalink structure simply override the item like so
``` yml
pagination:
enabled: true
category: cars
permalink: '/cars/:num/'
```
Overriding sorting to sort by the post title in ascending order for another paginated page could be done like so
``` yml
pagination:
enabled: true
category: ruby
sort_field: 'title'
sort_reverse: false
```
## Offsetting posts
The paging logic can be instructed to exclude the first _N_ number of newest posts from the pagination.
This can be useful in situations where your site treats the first N posts differently from the rest (e.g. a featured post that is always present).
The number of pages to skip is configured using the `offset` setting like so
``` yml
pagination:
enabled: true
offset: 3
```
This example skips the 3 newest posts from the pagination logic.
## Advanced Sorting
Sorting can be done by any field that is available in the post front-matter. You can even sort by nested fields.
> When sorting by nested fields separate the fields with a colon `:` character.
As an example, assuming all your posts have the following front-matter
``` yml
---
layout: post
author:
name:
first: "John"
last: "Smith"
born: 1960
---
```
You can define pagination sorting on the nested `first` field like so
``` yml
---
layout: page
title: "Authors by first name"
pagination:
enabled: true
sort_field: 'author:name:first'
---
```
To sort by the `born` year in decending order (youngest first)
``` yml
---
layout: page
title: "Authors by birth year"
pagination:
enabled: true
sort_field: 'author:born'
sort_reverse: true
---
```
## Creating Pagination Trails
Creating a trail structure for your pagination as shown above can be achieved by enabling the `trail` configuration and including a little extra code in your liquid templates.
``` yml
pagination:
trail:
before: 2 # The number of links before the current page
after: 2 # The number of links after the current page
```
Your layout file would then have to include code similar to the following to generate the correct HTML structure
``` HTML
{% if paginator.page_trail %}
{% for trail in paginator.page_trail %}
{{ trail.num }}
{% endfor %}
{% endif %}
```
_See [example 3](https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples/03-tags) for a demo of a pagination trail_
The `trail` object exposes three properties:
* `num`: The number of the page
* `path`: The path to the page
* `title`: The title of the page
The algorithm will always attempt to keep the same trail length for all pages (`trail length = before + after + 1`).
As an example if we have only 7 pagination pages in total and the user is currently on page 6 then the trail would look like this
Different number of before and after trail links can be specified. Below is an example of how the yml config below would look like when on the same page 4
``` yml
pagination:
trail:
before: 1
after: 3
```
## Detecting generated pagination pages
To identify the auto-generated pages that are created by the pagination logic when iterating through collections such as `site.pages` the `page.autogen` variable can be used like so
```
{% for my_page in site.pages %}
{% if my_page.title and my_page.autogen == nil %}
{{ my_page.title | escape }}
{% endif %}
{% endfor %}
```
_In this example only pages that have a title and are not auto-generated are included._
This variable is created and assigned the value `page.autogen = "jekyll-paginate-v2"` by the pagination logic. This way you can detect which pages are auto-generated and by what gem.
## Formatting page titles
The `title` field in both the site.config and the front-matter configuration supports the following macros.
| Text | Replaced with | Example |
| --- | --- | --- |
| :title | original page title | Page with `title: "Index"` and paginate config `title: ":title - split"` becomes `Index - split` |
| :num | number of the current page | Page with `title: "Index"` and paginate config `title: ":title (page :num)"` the second page becomes `Index (page 2)` |
| :max | total number of pages | Page with paginate config `title: ":num of :max"` the third page of 10 will become `3 of 10"` |
## Reading pagination meta information
Each pagination page defines an information structure `pagination_info` that is available to the liquid templates. This structure contains meta information for the pagination process, such as current pagination page and the total number of paginated pages.
The following fields are available
| Field | Description |
| --- | --- |
| curr_page | The number of the current pagination page |
| total_pages | The total number of pages in this pagination |
Below is an example on how to print out a "Page x of n" in the pagination layout
``` html
Page {{page.pagination_info.curr_page}} of {{page.pagination_info.total_pages}}
```
## Generating a JSON API
Delivering content via an API is useful, for a lot of the same reasons that pagination is useful. We want to delivery content, in such a way, that is:
1. Easy for the user to consume.
2. Easy for the browser to load.
Paginating content meets both of these requirements, but developers are limited to presenting content statically rather than dynamically. Some example of dynamic content delivery are:
- Pop up modals
- Infinite scrolling
- Multi-tiered pagination (e.g. Netflix UI horizontal scrolling for multiple movie categories)
### So how do I generate a JSON API for Jekyll?
First, create a new jekyll page and set its layout to `null` to avoid any extra html to show up.
Next, use the `extension` and `indexpage` option to customize the output of the page and its paginated content as JSON files.
> Note that the `indexpage` field also supports the same macros as the permalink field
Here's an example page:
```
---
layout: null
permalink: /api
pagination:
permalink: ''
enabled: true
extension: .json
indexpage: 'feed-:num'
---
{
"pages": [{% for post in paginator.posts %}
{% if forloop.first != true %},{% endif %}
{
"title": "{{ post.title }}",
"link": "{{ post.url }}"
}{% endfor %}
]
}
```
Next, run `jekyll build`. This will generate a set of paginated JSON files under the folder `/api`. These JSON files can be loaded via Javascript/AJAX to dynamically load content into your site.
Below's an example set of routes that the configuration would generate:
- http://localhost:4000/api/feed-1.json
- http://localhost:4000/api/feed-2.json
- http://localhost:4000/api/feed-3.json
And here is an example of one of the feed.json files that are created given the markup above
```
{
"pages": [
{
"title": "Narcisse Snake Pits",
"link": "/2016/11/narcisse-snake-pits.html"
},{
"title": "Luft-Fahrzeug-Gesellschaft",
"link": "/2016/11/luft-fahrzeug-gesellschaft.html"
},{
"title": "Rotary engine",
"link": "/2016/11/rotary-engine.html"
}
],
"next": "/api/feed-11.json",
"prev": "/api/feed-9.json",
"first": "/api/feed-1.json"
}
```
For further information see [Example 4](https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples/04-jsonapi), that project can serve as a starting point for your experiments with this feature.
### How did you generate those 'next', 'prev' and 'first' links?
All the normal paginator variables can be used in these JSON feed files. You can use them to achive quite powerful features such as pre-loading and detecting when there are no more feeds to load.
```
{% if paginator.next_page %}
,"next": "{{ paginator.next_page_path }}"
{% endif %}
{% if paginator.last_page %}
,"prev": "{{ paginator.last_page_path }}"
{% endif %}
{% if paginator.first_page %}
,"first": "{{ paginator.first_page_path }}"
{% endif %}
```
## Renaming pagination file names
By default the pagination system creates all paginated pages as `index.html`. The system provides an option to override this name and file extension with the
```yml
indexpage: index
extension: html
```
If you wanted to generate all pagination files as `default.htm` then the settings should be configured as follows
```yml
indexpage: default
extension: htm
```
## Common issues
### I keep getting a dependency error when running jekyll serve after installing this gem
> Dependency Error: Yikes! It looks like you don't have jekyll-paginate-v2 or one of its dependencies installed...
Check your `Gemfile` in the site root. Ensure that the jekyll-paginate-v2 gem is present in the jekyll_plugins group like the example below. If this group is missing add to the file.
``` ruby
group :jekyll_plugins do
gem "jekyll-paginate-v2"
end
```
### I'm getting a bundler error after upgrading the gem (Bundler::GemNotFound)
> bundler/spec_set.rb:95:in `block in materialize': Could not find jekyll-paginate-v2-1.0.0 in any of the sources (Bundler::GemNotFound)
Delete your `Gemfile.lock` file and try again.
### I'm getting a bundler error after upgrading the gem (Gem::LoadError)
> bundler/runtime.rb:40:in 'block in setup': You have already activated addressable 2.5.0, but your Gemfile requires addressable 2.4.0. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
Delete your `Gemfile.lock` file and try again.
### My pagination pages are not being found (Couldn't find any pagination page. Skipping pagination)
> Pagination: Is enabled, but I couldn't find any pagination page. Skipping pagination...
* Ensure that you have the correct minimum front-matter in the pagination pages
``` yml
pagination:
enabled: true
```
* You can place pagination logic into either the pages or liquid templates (templates are stored under the `_layouts/` and `_includes/` folders).
### My pages are being nested multiple levels deep
When using `categories` for posts it is advisable to explicitly state a `permalink` structure in your `_config.yml` file.
```
permalink: /:year/:month/:title.html
```
This is because the default behavior in Jekyll is to nest pages for every category that they belong to and Jekyll unfortunately does not understand multi-categories separated with `,` or `;` but instead does all separation on `[space]` only.
### My pagination pages are overwriting each others pages
If you specify multiple pages that paginate in the site root then you must give them unique and separate pagination permalink. This link is set in the pagination page front-matter like so
``` yml
pagination:
enabled: true
permalink: '/cars/:num/'
```
Make absolutely sure that your pagination permalink paths do not clash with any other paths in your final site. For simplicity it is recommended that you keep all custom pagination (non root index.html) in a single or multiple separate sub folders under your site root.
jekyll-paginate-v2-3.0.0/README.md 0000664 0000000 0000000 00000011657 13617374403 0016420 0 ustar 00root root 0000000 0000000 # Jekyll::Paginate V2
Pagination gem built specially for Jekyll 3 and newer that is fully backwards compatible and serves as an enhanced replacement for the previously built-in [jekyll-paginate gem](https://github.com/jekyll/jekyll-paginate). View it on [rubygems.org](https://rubygems.org/gems/jekyll-paginate-v2).
[](https://www.codeshelter.co/)
[](https://rubygems.org/gems/jekyll-paginate-v2)
[](https://gitter.im/jekyll-paginate-v2/Lobby)
[](https://travis-ci.org/sverrirs/jekyll-paginate-v2)
[](https://codeclimate.com/github/sverrirs/jekyll-paginate-v2)
[](https://hakiri.io/github/sverrirs/jekyll-paginate-v2/master)
[](https://rubygems.org/gems/jekyll-paginate-v2)
Reach me at the [project issues](https://github.com/sverrirs/jekyll-paginate-v2/issues) section or via email at [jekyll@sverrirs.com](mailto:jekyll@sverrirs.com), you can also get in touch on the project's [Gitter chat room](https://gitter.im/jekyll-paginate-v2/Lobby).
> The code was based on the original design of [jekyll-paginate](https://github.com/jekyll/jekyll-paginate) and features were sourced from discussions such as [#27](https://github.com/jekyll/jekyll-paginate/issues/27) (thanks [Günter Kits](https://github.com/gynter)).
* [Installation](#installation)
* [Example Sites](https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples)
* [Pagination Generator](#pagination-generator)
* [Auto-Pages](#auto-pages)
* [Issues / to-be-completed](#issues--to-be-completed)
* [How to Contribute](#contributing)
> _"Be excellent to each other"_
:heart:
## Installation
```
gem install jekyll-paginate-v2
```
Update your [_config.yml](README-GENERATOR.md#site-configuration) and [pages](README-GENERATOR.md#page-configuration).
> Although fully backwards compatible, to enable the new features this gem needs slightly extended [site yml](README-GENERATOR.md#site-configuration) configuration and miniscule additional new front-matter for the [pages to paginate on](README-GENERATOR.md#page-configuration).
Now you're ready to run `jekyll serve` and your paginated files should be generated.
Please see the [Examples](https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples) for tips and tricks on how to configure the pagination logic.
> :warning: Please note that this plugin is currently NOT supported by GitHub pages. Here is a [list of all plugins supported](https://pages.github.com/versions/). There is work underway to try to get it added it but until then please follow [this GitHub guide](https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/) to enable it or use [Travis CI](https://ayastreb.me/deploy-jekyll-to-github-pages-with-travis-ci/).
> GitLab supposedly supports [any plugin](https://about.gitlab.com/comparison/gitlab-pages-vs-github-pages.html).
## Pagination Generator
The [Pagination Generator](README-GENERATOR.md) forms the core of the pagination logic. Calculates and generates the pagination pages.
## Auto Pages
The [Auto-Pages](README-AUTOPAGES.md) is an optional feature that auto-magically generates paginated pages for all your tags, categories and collections.
## Issues / to-be-completed
* Unit-tests do not cover all critical code paths
* No integration tests yet [#2](https://github.com/jekyll/jekyll-paginate/pull/2)
* _Exclude_ filter not implemented [#6](https://github.com/jekyll/jekyll-paginate/issues/6)
* Elegant way of collecting and printing debug information during pagination
I welcome all testers and people willing to give me feedback and code reviews.
## Contributing
> Although this project is small it has a [code of conduct](CODE_OF_CONDUCT.md) that I hope everyone will do their best to follow when contributing to any aspects of this project. Be it discussions, issue reporting, documentation or programming.
If you don't want to open issues here on Github, send me your feedback by email at [jekyll@sverrirs.com](mailto:jekyll@sverrirs.com).
1. Fork it ( https://github.com/sverrirs/jekyll-paginate-v2/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Run the unit tests (`rake`)
4. Commit your changes (`git commit -am 'Add some feature'`)
5. Build the gem locally (`gem build jekyll-paginate-v2.gemspec`)
6. Test and verify the gem locally (`gem install ./jekyll-paginate-v2-x.x.x.gem`)
7. Push to the branch (`git push origin my-new-feature`)
8. Create new Pull Request
Note: This project uses [semantic versioning](http://semver.org/).
jekyll-paginate-v2-3.0.0/Rakefile 0000664 0000000 0000000 00000000552 13617374403 0016576 0 ustar 00root root 0000000 0000000 require 'rake'
require 'rake/testtask'
#$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
#require 'lib/jekyll-paginate-v2/version'
Rake::TestTask.new do |t|
t.libs.push 'lib'
t.libs.push 'specs'
t.verbose = true
t.pattern = "spec/**/*_spec.rb"
t.test_files = FileList['spec/**/*_spec.rb']
end
desc "Run tests"
task :default => [:test] jekyll-paginate-v2-3.0.0/examples/ 0000775 0000000 0000000 00000000000 13617374403 0016745 5 ustar 00root root 0000000 0000000 jekyll-paginate-v2-3.0.0/examples/01-typicalblog/ 0000775 0000000 0000000 00000000000 13617374403 0021474 5 ustar 00root root 0000000 0000000 jekyll-paginate-v2-3.0.0/examples/01-typicalblog/README.md 0000664 0000000 0000000 00000005330 13617374403 0022754 0 ustar 00root root 0000000 0000000 # Example 01::Typical Blog
This example site shows how the pagination gem can be used on a simple blog site.
The site is generated using the jekyll built in new command `jekyll new myblog` and it uses the [default `minima` theme](https://github.com/jekyll/minima).
After generating the pagination gem was installed using
```
gem install jekyll-paginate-v2
```
## Structure
The blog has only one type of posts, blog posts. No category pagination is performed. To implement the pagination for the minima theme the `_layouts/home.html` needed to be modified to call the pagination logic.
The `_includes/header.html` was also overridden to omit listing the auto-generated pagination sites at the top of the header part.
## Setup configuration
The gem is added to the `_config.yml` file under
``` yml
gems:
- jekyll-paginate-v2
```
as well as to the `Gemfile` into the main loop
``` ruby
group :jekyll_plugins do
gem "jekyll-paginate-v2"
gem "jekyll-feed"
end
```
At this point is is advisable to delete the `Gemfile.lock` file to clear out any potential issues with gem caching and dependency issues (no worries this file will be auto generated for you again).
## Configuring the pagination
Add the pagination configuration to `_config.yml`
``` yml
# Pagination Settings
pagination:
enabled: true
per_page: 3
permalink: '/page/:num/'
title_suffix: ' - page :num'
limit: 0
sort_field: 'date'
sort_reverse: true
```
Due to the way the entries in the blog utilize multiple categories it is also good to explicitly state the permalink format to avoid excessive nesting of the post pages. So place the following line into the `_config.yml` file as well
``` yml
# Produces a cleaner folder structure when using categories
permalink: /:year/:month/:title.html
```
## Completing the setup
Now the pagination simply needs to be enabled in the `index.html` file.
``` yml
---
layout: home
pagination:
enabled: true
---
```
That is it, no further configuration is needed!
Try building the site yourself using `jekyll build` or `jekyll serve`.
## Testing backwards compatability
In the `_config.yml` file remove or comment out the new `pagination:` configuration and paste/uncomment the following configuration instead.
``` yml
# Old jekyll-paginate pagination logic
paginate: 3
paginate_path: "/legacy/page:num/"
```
Now run `jekyll serve` again and the gem will generate the pagination according to the old jekyll-paginate rules and behavior.
> You must disable the new pagination configuration for the old one to work. You cannot run both configurations at the same time.
Cheers :heart:
jekyll-paginate-v2-3.0.0/examples/01-typicalblog/_config.yml 0000664 0000000 0000000 00000003706 13617374403 0023631 0 ustar 00root root 0000000 0000000 # Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing these this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Paginate Example - 01 Typical Blog
email: jekyll@sverrirs.com
description: > # this means to ignore newlines until "baseurl:"
Shows how the jekyll-paginate-v2 gem can be used on a typical blog created in Jekyll.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
github_username: sverrirs
# Build settings
markdown: kramdown
theme: minima
gems:
- jekyll-paginate-v2
exclude:
- Gemfile
- Gemfile.lock
# Produces a cleaner folder structure when using categories
permalink: /:year/:month/:title.html
# Explicitly turn off the old code
paginate: nil
paginate_path: nil
# Pagination Settings
pagination:
enabled: true
per_page: 3
offset: 2
permalink: '/page/:num/'
title: ':title - page :num of :max'
limit: 0
sort_field: 'date'
sort_reverse: true
############################################################
# Old jekyll-paginate pagination logic
# Uncomment thew two entries below to demonstrate how this new gem
# retains backwards compatibility with the old pagination logic
# AS OF JANUARY 2018 this code does not work anymore!
#paginate: 3
#paginate_path: "/legacy/page:num/" jekyll-paginate-v2-3.0.0/examples/01-typicalblog/_includes/ 0000775 0000000 0000000 00000000000 13617374403 0023441 5 ustar 00root root 0000000 0000000 jekyll-paginate-v2-3.0.0/examples/01-typicalblog/_includes/header.html 0000664 0000000 0000000 00000002667 13617374403 0025572 0 ustar 00root root 0000000 0000000