2020-08-23 00:04:46 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Permite generar el sitio en una versión privada, mostrando información
|
|
|
|
# que no se vería públicamente (borradores, campos privados, etc.)
|
|
|
|
#
|
|
|
|
# XXX: La plantilla tiene que soportar esto con el plugin
|
|
|
|
# jekyll-private-data
|
|
|
|
class DeployPrivate < DeployLocal
|
2023-03-18 22:01:13 +00:00
|
|
|
DEPENDENCIES = %i[deploy_local]
|
|
|
|
|
2020-08-23 00:04:46 +00:00
|
|
|
# No es necesario volver a instalar dependencias
|
2022-03-16 21:19:04 +00:00
|
|
|
def deploy(output: false)
|
|
|
|
jekyll_build(output: output)
|
2020-08-23 00:04:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Hacer el deploy a un directorio privado
|
|
|
|
def destination
|
|
|
|
File.join(Rails.root, '_private', site.name)
|
|
|
|
end
|
|
|
|
|
2022-04-06 23:07:14 +00:00
|
|
|
def url
|
|
|
|
"#{ENV['PANEL_URL']}/sites/private/#{site.name}"
|
|
|
|
end
|
|
|
|
|
2020-08-23 00:04:46 +00:00
|
|
|
# No usar recursos en compresión y habilitar los datos privados
|
|
|
|
def env
|
2020-10-04 00:45:30 +00:00
|
|
|
@env ||= super.merge({
|
2020-10-09 12:24:12 +00:00
|
|
|
'JEKYLL_ENV' => 'development',
|
|
|
|
'JEKYLL_PRIVATE' => site.private_key
|
2020-10-04 00:45:30 +00:00
|
|
|
})
|
2020-08-23 00:04:46 +00:00
|
|
|
end
|
|
|
|
end
|