From e49d8484a240ac09021d9d00c14a1b9df7b4baf2 Mon Sep 17 00:00:00 2001 From: f Date: Sun, 1 Aug 2021 21:53:52 -0300 Subject: [PATCH] Refactorizar DeployPrivate --- app/models/deploy_private.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/models/deploy_private.rb b/app/models/deploy_private.rb index 3a6595f9..30aca8b8 100644 --- a/app/models/deploy_private.rb +++ b/app/models/deploy_private.rb @@ -11,12 +11,31 @@ class DeployPrivate < DeployLocal jekyll_build end - # Hacer el deploy a un directorio privado + # La URL del sitio dentro del panel. + # + # @return [String] + def url + Rails.application.routes.url_for(controller: :private, action: :show, site_id: site) + end + + # Hacer el deploy a un directorio privado. + # + # @return [String] def destination File.join(Rails.root, '_private', site.name) end + # El hostname no se usa para nada, porque el sitio es solo accesible a + # través del panel de Sutty. + # + # @return [String] + def default_hostname + "#{site.name}.private.#{Site.domain}" + end + # No usar recursos en compresión y habilitar los datos privados + # + # @return [Hash] def env @env ||= super.merge({ 'JEKYLL_ENV' => 'development',