mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 08:41:42 +00:00
fix: cargar jekyll cuando realmente se lo usa
This commit is contained in:
parent
d896a111b8
commit
f35f4c0f06
1 changed files with 5 additions and 7 deletions
|
@ -54,10 +54,6 @@ class Site < ApplicationRecord
|
|||
before_create :clone_skel!
|
||||
# Elimina el directorio al destruir un sitio
|
||||
before_destroy :remove_directories!
|
||||
# Carga el sitio Jekyll una vez que se inicializa el modelo o después
|
||||
# de crearlo
|
||||
after_initialize :install_gems, :load_jekyll
|
||||
after_create :install_gems, :load_jekyll
|
||||
# Cambiar el nombre del directorio
|
||||
before_update :update_name!
|
||||
before_save :add_private_key_if_missing!
|
||||
|
@ -338,12 +334,14 @@ class Site < ApplicationRecord
|
|||
end
|
||||
|
||||
def jekyll
|
||||
run_in_path do
|
||||
@jekyll ||=
|
||||
@jekyll ||=
|
||||
begin
|
||||
install_gems
|
||||
|
||||
Jekyll::Site.new(configuration).tap do |site|
|
||||
site.reader = JekyllData::Reader.new(site) if site.theme
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Cargar el sitio Jekyll
|
||||
|
|
Loading…
Reference in a new issue