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

Find layout files from theme directories #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@ def initialize(site, base, autopage_config, pagination_config, layout_name, set_
end

self.process(@name) # Creates the base name and extension
self.read_yaml(File.join(site.source, layout_dir), layout_name)

layout = @site.layouts.find { |k,v| v.name == layout_name }[1]

if layout.path.end_with? 'html'
@path = layout.path
else
@path = File.join(layout.path, layout.name)
end

base_path = @path.dup
base_path.slice! layout.name
self.read_yaml(base_path, layout.name)

# Merge the config with any config that might already be defined in the layout
pagination_layout_config = Jekyll::Utils.deep_merge_hashes( pagination_config, self.data['pagination'] || {} )
Expand Down