5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 12:36:22 +00:00

feat: obtener el post a partir del post indexado

This commit is contained in:
f 2023-10-06 09:57:44 -03:00
parent ae745b3d46
commit ecf44311ea
No known key found for this signature in database

View file

@ -57,6 +57,22 @@ class IndexedPost < ApplicationRecord
@document ||= Jekyll::Document.new(full_path, site: site.jekyll, collection: collection) @document ||= Jekyll::Document.new(full_path, site: site.jekyll, collection: collection)
end end
# El Post
#
# @todo Decidir qué pasa si el archivo ya no existe
# @return [Post]
def post
@post ||= Post.new(document: document, site: site, layout: schema)
end
# Devuelve el esquema de datos
#
# @todo Renombrar
# @return [Layout]
def schema
site.layouts[layout.to_sym]
end
# Convertir locale a direccionario de PG # Convertir locale a direccionario de PG
# #
# @param [String,Symbol] # @param [String,Symbol]