From e1d80e485369fbf031643f93f05a3410adba45b1 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 26 Oct 2023 18:08:44 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20poder=20pasar=20el=20layout=20como=20s?= =?UTF-8?q?=C3=ADmbolo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/post.rb | 2 ++ app/models/site/index.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 097543b0..227ef744 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -57,6 +57,8 @@ class Post end end + args[:layout] = args[:site].layouts[args[:layout]] if args[:layout].is_a? Symbol + Post.new(**args) end end diff --git a/app/models/site/index.rb b/app/models/site/index.rb index 2cb950cb..7a070e6d 100644 --- a/app/models/site/index.rb +++ b/app/models/site/index.rb @@ -20,7 +20,7 @@ class Site jekyll.documents.each do |doc| doc.read! - Post.new(document: doc, site: self, layout: layouts[doc['layout'].to_sym]).index! + Post.new(document: doc, site: self, layout: doc['layout'].to_sym).index! end update(last_indexed_commit: repository.head_commit.oid)