cargar el css desde el sitio

This commit is contained in:
f 2019-01-09 17:37:34 -03:00
parent 56ad911dc1
commit 47b82d0771
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
2 changed files with 6 additions and 0 deletions

View file

@ -304,6 +304,10 @@ class Site
File.join('/', 'sites', id, path.gsub('..', ''))
end
def get_url_from_site(path)
"https://#{name}#{path}"
end
# El directorio donde se almacenan los sitios
def self.site_path
File.join(Rails.root, '_sites')

View file

@ -6,6 +6,8 @@
= csrf_meta_tags
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
- if @site.try(:config).try(:dig, 'css')
%link{rel: 'stylesheet', type: 'text/css', href: @site.get_url_from_site(@site.config.dig('css'))}
- style = "background-image: url(#{@site.try(:cover) || image_url('background.jpg')})"
%body{class: @has_cover ? 'background-cover' : '', style: @has_cover ? style : ''}
.container-fluid