mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-29 23:06:21 +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)
|
@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]
|
||||||
|
|
Loading…
Reference in a new issue