mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-24 23:21:48 +00:00
Merge branch 'deploy-locales' into panel.sutty.nl
This commit is contained in:
commit
230d762fa7
2 changed files with 13 additions and 1 deletions
|
@ -46,7 +46,7 @@ module Api
|
|||
|
||||
# Dominios alternativos
|
||||
def alternative_names
|
||||
DeployAlternativeDomain.all.map(&:hostname)
|
||||
DeployAlternativeDomain.all.map(&:hostname) + DeployLocalizedDomain.all.map(&:hostname)
|
||||
end
|
||||
|
||||
# Obtener todos los sitios con API habilitada, es decir formulario
|
||||
|
|
12
app/models/deploy_localized_domain.rb
Normal file
12
app/models/deploy_localized_domain.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Soportar dominios localizados
|
||||
class DeployLocalizedDomain < DeployAlternativeDomain
|
||||
store :values, accessors: %i[hostname locale], coder: JSON
|
||||
|
||||
# Generar un link simbólico del sitio principal al alternativo
|
||||
def deploy
|
||||
File.symlink?(destination) ||
|
||||
File.symlink(File.join(site.hostname, locale), destination).zero?
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue