mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 10:26:22 +00:00
feat: obtener el post a partir del post indexado
This commit is contained in:
parent
ae745b3d46
commit
ecf44311ea
1 changed files with 16 additions and 0 deletions
|
@ -57,6 +57,22 @@ class IndexedPost < ApplicationRecord
|
|||
@document ||= Jekyll::Document.new(full_path, site: site.jekyll, collection: collection)
|
||||
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
|
||||
#
|
||||
# @param [String,Symbol]
|
||||
|
|
Loading…
Reference in a new issue