From b928fa7bde27ecb5b4e9126253dff9a86fa3936b Mon Sep 17 00:00:00 2001 From: f Date: Fri, 6 Oct 2023 09:56:12 -0300 Subject: [PATCH] BREAKING CHANGE: las colecciones no generan instancias de document --- app/models/indexed_post.rb | 7 +++++++ app/models/site.rb | 13 +++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/models/indexed_post.rb b/app/models/indexed_post.rb index 7e58b7bc..e59e1a2f 100644 --- a/app/models/indexed_post.rb +++ b/app/models/indexed_post.rb @@ -43,6 +43,13 @@ class IndexedPost < ApplicationRecord @full_path ||= File.join(site.path, "_#{locale}", "#{path}.markdown") end + # La colección + # + # @return [Jekyll::Collection] + def collection + site.collections[locale.to_s] + end + # Convertir locale a direccionario de PG # # @param [String,Symbol] diff --git a/app/models/site.rb b/app/models/site.rb index a8c5e376..690264b4 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -218,17 +218,10 @@ class Site < ApplicationRecord jekyll.data end - # Traer las colecciones. Todos los artículos van a estar dentro de - # colecciones. + # Trae las colecciones desde el sitio, sin leer su contenido + # + # @return [Hash] def collections - unless @read - run_in_path do - jekyll.reader.read_collections - end - - @read = true - end - jekyll.collections end