From 57457cfcc8201a28ad7afc1f06b2614b51eedc8f Mon Sep 17 00:00:00 2001 From: f Date: Thu, 28 Nov 2019 16:44:44 -0300 Subject: [PATCH] deshabilitar la lectura de ciertos archivos --- config/initializers/core_extensions.rb | 28 ++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/config/initializers/core_extensions.rb b/config/initializers/core_extensions.rb index 95cf9571..66003a00 100644 --- a/config/initializers/core_extensions.rb +++ b/config/initializers/core_extensions.rb @@ -1,6 +1,30 @@ # frozen_string_literal: true -require 'jekyll/document' - String.include CoreExtensions::String::StripTags Jekyll::Document.include CoreExtensions::Jekyll::Document::Path + +# Lazy Loading de Jekyll, deshabilitando la instanciación de elementos +# que no necesitamos +# +# TODO: Aplicar monkey patches en otro lado... +module Jekyll + Site.class_eval do + def setup + ensure_not_in_dest + end + end + + Reader.class_eval do + def retrieve_posts(_); end + + def retrieve_dirs(_, _, _); end + + def retrieve_pages(_, _); end + + def retrieve_static_files(_, _); end + end + + ThemeAssetsReader.class_eval do + def read; end + end +end