From d9171ff4d55fa68c65e3a572d6e7c7569e71338e Mon Sep 17 00:00:00 2001 From: MoHKale Date: Sat, 8 Feb 2020 07:40:48 +0000 Subject: [PATCH 1/2] baseAutoPage.rb (config): use layouts_dir site.config option --- lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb b/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb index 912da48..ac170c8 100644 --- a/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb +++ b/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb @@ -7,7 +7,7 @@ def initialize(site, base, autopage_config, pagination_config, layout_name, set_ @base = base @name = 'index.html' - layout_dir = '_layouts' + layout_dir = site.config['layouts_dir'] || '_layouts' # Path is only used by the convertible module and accessed below when calling read_yaml # Handling themes stored in a gem @@ -57,4 +57,4 @@ def initialize(site, base, autopage_config, pagination_config, layout_name, set_ end #function initialize end #class BaseAutoPage end # module PaginateV2 -end # module Jekyll \ No newline at end of file +end # module Jekyll From b4af4ddccd2472d8469bce2109d62b21bad88024 Mon Sep 17 00:00:00 2001 From: MoHKale Date: Sat, 8 Feb 2020 07:47:05 +0000 Subject: [PATCH 2/2] baseAutoPage.rb (feature): support hirearchal layouts allows specifying layouts in subdirectories, instead of just the root directory of where-ever your layouts are. --- lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb b/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb index ac170c8..7204380 100644 --- a/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb +++ b/lib/jekyll-paginate-v2/autopages/pages/baseAutoPage.rb @@ -40,7 +40,8 @@ def initialize(site, base, autopage_config, pagination_config, layout_name, set_ @url = File.join(permalink_formatted, @name) @dir = permalink_formatted - self.data['layout'] = File.basename(layout_name, File.extname(layout_name)) + self.data['layout'] = File.join(File.dirname(layout_name), + File.basename(layout_name, '.*')) self.data['title'] = get_autopage_title_lambda.call( page_title ) self.data['pagination'] = pagination_layout_config # Store the pagination configuration