5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 11:26:21 +00:00

ya no es necesario incluir las plantillas en sutty

esto nos da flexibilidad para poder incluir más plantillas en sutty solo
agregándolas a la lista de diseños disponibles, sin tener que deployear
sutty.  además cada sitio puede tener su propia versión de la gema y
esto obliga a tener siempre la última.

fixes #1849
This commit is contained in:
f 2021-05-29 13:25:06 -03:00
parent 752569c8a7
commit 5e3d5e3482
4 changed files with 28 additions and 185 deletions

12
Gemfile
View file

@ -91,18 +91,6 @@ gem 'net-ssh'
gem 'ed25519'
gem 'bcrypt_pbkdf'
group :themes do
gem 'adhesiones-jekyll-theme', require: false
gem 'editorial-autogestiva-jekyll-theme', require: false
gem 'minima', require: false
gem 'sutty-minima', require: false
gem 'radios-comunitarias-jekyll-theme', require: false
gem 'share-to-fediverse-jekyll-theme', require: false
gem 'sutty-donaciones-jekyll-theme', require: false
gem 'sutty-jekyll-theme', require: false
gem 'recursero-jekyll-theme', require: false
end
group :production do
gem 'lograge'
end

View file

@ -79,23 +79,14 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
adhesiones-jekyll-theme (0.2.1)
jekyll (~> 4.0)
jekyll-data (~> 1.1)
jekyll-feed (~> 0.9)
jekyll-images (~> 0.2)
jekyll-include-cache (~> 0)
jekyll-locales (~> 0.1)
jekyll-relative-urls (~> 0.0)
jekyll-seo-tag (~> 2.1)
ast (2.4.2)
autoprefixer-rails (10.2.5.1)
execjs (> 0)
autoprefixer-rails (10.3.1.0)
execjs (~> 2)
bcrypt (3.1.16-x86_64-linux-musl)
bcrypt_pbkdf (1.1.0-x86_64-linux-musl)
benchmark-ips (2.9.1)
bindex (0.8.1-x86_64-linux-musl)
blazer (2.4.2)
blazer (2.4.3)
activerecord (>= 5)
chartkick (>= 3.2)
railties (>= 5)
@ -104,7 +95,7 @@ GEM
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
brakeman (5.0.4)
brakeman (5.1.1)
builder (3.2.4)
capybara (2.18.0)
addressable
@ -157,28 +148,9 @@ GEM
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
down (5.2.2)
addressable (~> 2.5)
down (5.2.3)
addressable (~> 2.8)
ed25519 (1.2.4-x86_64-linux-musl)
editorial-autogestiva-jekyll-theme (0.3.4)
jekyll (~> 4)
jekyll-commonmark (~> 1.3)
jekyll-data (~> 1.1)
jekyll-dotenv (>= 0.2)
jekyll-feed (~> 0.15)
jekyll-hardlinks (~> 0)
jekyll-ignore-layouts (~> 0)
jekyll-images (~> 0.2)
jekyll-include-cache (~> 0)
jekyll-linked-posts (~> 0)
jekyll-locales (~> 0.1)
jekyll-order (~> 0)
jekyll-relative-urls (~> 0)
jekyll-seo-tag (~> 2)
jekyll-spree-client (~> 0)
jekyll-unique-urls (~> 0)
jekyll-write-and-commit-changes (~> 0)
sutty-liquid (~> 0)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
@ -194,7 +166,7 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
fast_blank (1.0.0-x86_64-linux-musl)
fast_blank (1.0.1-x86_64-linux-musl)
fast_jsonparser (0.5.0-x86_64-linux-musl)
ffi (1.15.3-x86_64-linux-musl)
flamegraph (0.9.5)
@ -203,13 +175,13 @@ GEM
activerecord (>= 4.0.0)
get_process_mem (0.2.7)
ffi (~> 1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalid (0.5.2)
activesupport (>= 5.0)
hairtrigger (0.2.24)
activerecord (>= 5.0, < 7)
ruby2ruby (~> 2.4)
ruby_parser (~> 3.10)
haml (5.2.1)
haml (5.2.2)
temple (>= 0.8.0)
tilt
haml-lint (0.999.999)
@ -220,7 +192,7 @@ GEM
rainbow
rubocop (>= 0.50.0)
sysexits (~> 1.1)
hamlit (2.15.0-x86_64-linux-musl)
hamlit (2.15.1-x86_64-linux-musl)
temple (>= 0.8.2)
thor
tilt
@ -269,46 +241,16 @@ GEM
jekyll (>= 3.7, < 5.0)
jekyll-data (1.1.2)
jekyll (>= 3.3, < 5.0.0)
jekyll-dotenv (0.2.0)
dotenv (~> 2.7)
jekyll (~> 4)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-hardlinks (0.1.2)
jekyll (~> 4)
jekyll-ignore-layouts (0.1.0)
jekyll (~> 4)
jekyll-images (0.2.7)
jekyll (~> 4)
ruby-filemagic (~> 0.7)
ruby-vips (~> 2)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-linked-posts (0.4.0)
jekyll (~> 4)
jekyll-locales (0.1.12)
jekyll-lunr (0.3.0)
loofah (~> 2.4)
jekyll-order (0.1.4)
jekyll-relative-urls (0.0.6)
jekyll (~> 4)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-spree-client (0.1.15)
fast_blank (~> 1)
spree-api-client (~> 0.2)
jekyll-turbolinks (0.0.5)
jekyll (~> 4)
turbolinks-source (~> 5)
jekyll-unique-urls (0.1.1)
jekyll (~> 4)
jekyll-watch (2.2.1)
listen (~> 3.0)
jekyll-write-and-commit-changes (0.1.2)
jekyll (~> 4)
rugged (~> 1)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
@ -330,7 +272,7 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.10.0)
loofah (2.12.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@ -345,19 +287,15 @@ GEM
mini_histogram (0.3.1)
mini_magick (4.11.0)
mini_mime (1.1.0)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.14.4)
mobility (1.1.2)
mobility (1.1.3)
i18n (>= 0.6.10, < 2)
request_store (~> 1.0)
multi_xml (0.6.0)
net-ssh (6.1.0)
netaddr (2.0.4)
nio4r (2.5.7-x86_64-linux-musl)
nokogiri (1.11.7-x86_64-linux)
nio4r (2.5.8-x86_64-linux-musl)
nokogiri (1.12.3-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.20.1)
@ -370,15 +308,15 @@ GEM
activerecord (>= 5.2)
activesupport (>= 5.2)
popper_js (1.16.0)
prometheus_exporter (0.8.0)
prometheus_exporter (0.8.1)
webrick
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
puma (5.3.2-x86_64-linux-musl)
puma (5.4.0-x86_64-linux-musl)
nio4r (~> 2.0)
pundit (2.1.0)
pundit (2.1.1)
activesupport (>= 3.0.0)
racc (1.5.2-x86_64-linux-musl)
rack (2.2.3)
@ -390,17 +328,6 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
radios-comunitarias-jekyll-theme (0.1.5)
jekyll (~> 4.0)
jekyll-data (~> 1.1)
jekyll-feed (~> 0.9)
jekyll-images (~> 0.2)
jekyll-include-cache (~> 0)
jekyll-linked-posts (~> 0)
jekyll-locales (~> 0.1)
jekyll-relative-urls (~> 0.0)
jekyll-seo-tag (~> 2.1)
jekyll-turbolinks (~> 0)
rails (6.1.4)
actioncable (= 6.1.4)
actionmailbox (= 6.1.4)
@ -419,7 +346,7 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
rails-html-sanitizer (1.4.1)
loofah (~> 2.3)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
@ -437,25 +364,7 @@ GEM
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
recursero-jekyll-theme (0.2.0)
jekyll (~> 4)
jekyll-commonmark (~> 1.3)
jekyll-data (~> 1.1)
jekyll-dotenv (>= 0.2)
jekyll-feed (~> 0.15)
jekyll-ignore-layouts (~> 0)
jekyll-images (~> 0.2)
jekyll-include-cache (~> 0)
jekyll-linked-posts (~> 0)
jekyll-locales (~> 0.1)
jekyll-lunr (~> 0.1)
jekyll-order (~> 0)
jekyll-relative-urls (~> 0)
jekyll-seo-tag (~> 2)
jekyll-unique-urls (~> 0.1)
sutty-archives (~> 2.2)
sutty-liquid (~> 0)
redis (4.3.1)
redis (4.4.0)
redis-actionpack (5.2.0)
actionpack (>= 5, < 7)
redis-rack (>= 2.1.0, < 3)
@ -480,16 +389,16 @@ GEM
railties (>= 5.0)
rexml (3.2.5)
rouge (3.26.0)
rubocop (1.18.3)
rubocop (1.19.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.7.0, < 2.0)
rubocop-ast (>= 1.9.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.7.0)
rubocop-ast (1.10.0)
parser (>= 3.0.1.1)
rubocop-rails (2.11.3)
activesupport (>= 4.2.0)
@ -506,7 +415,7 @@ GEM
ruby_parser (~> 3.1)
sexp_processor (~> 4.6)
ruby_dep (1.5.0)
ruby_parser (3.16.0)
ruby_parser (3.17.0)
sexp_processor (~> 4.15, >= 4.15.1)
rubyzip (2.3.2)
rugged (1.1.1-x86_64-linux-musl)
@ -526,20 +435,9 @@ GEM
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
sexp_processor (4.15.3)
share-to-fediverse-jekyll-theme (0.1.4)
jekyll (~> 4.0)
jekyll-data (~> 1.1)
jekyll-feed (~> 0.9)
jekyll-images (~> 0.2)
jekyll-include-cache (~> 0)
jekyll-relative-urls (~> 0.0)
jekyll-seo-tag (~> 2.1)
simpleidn (0.2.1)
unf (~> 0.1.4)
sourcemap (0.1.1)
spree-api-client (0.2.2)
fast_blank (~> 1)
httparty (~> 0.18.0)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
@ -555,32 +453,9 @@ GEM
stackprof (0.2.17-x86_64-linux-musl)
sucker_punch (3.0.1)
concurrent-ruby (~> 1.0)
sutty-archives (2.5.4)
jekyll (>= 3.6, < 5.0)
sutty-donaciones-jekyll-theme (0.1.2)
jekyll (~> 4.0)
jekyll-data (~> 1.1)
jekyll-feed (~> 0.9)
jekyll-images (~> 0.2)
jekyll-include-cache (~> 0)
jekyll-locales (~> 0.1)
jekyll-relative-urls (~> 0.0)
jekyll-seo-tag (~> 2.1)
sutty-archives (~> 2.2)
sutty-jekyll-theme (0.1.2)
jekyll (~> 4.0)
jekyll-feed (~> 0.9)
jekyll-images (~> 0.2)
jekyll-include-cache (~> 0)
jekyll-relative-urls (~> 0.0)
jekyll-seo-tag (~> 2.1)
sutty-liquid (0.7.3)
fast_blank (~> 1.0)
jekyll (~> 4)
sutty-minima (2.5.0)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
symbol-fstring (1.0.2-x86_64-linux-musl)
sysexits (1.2.0)
temple (0.8.2)
@ -628,7 +503,6 @@ PLATFORMS
x86_64-linux-musl
DEPENDENCIES
adhesiones-jekyll-theme
bcrypt (~> 3.1.7)
bcrypt_pbkdf
blazer
@ -645,7 +519,6 @@ DEPENDENCIES
dotenv-rails
down
ed25519
editorial-autogestiva-jekyll-theme
email_address!
exception_notification
factory_bot_rails
@ -674,7 +547,6 @@ DEPENDENCIES
lograge
memory_profiler
mini_magick
minima
mobility
net-ssh
pg
@ -685,11 +557,9 @@ DEPENDENCIES
pundit
rack-cors
rack-mini-profiler
radios-comunitarias-jekyll-theme
rails (~> 6)
rails-i18n
rails_warden
recursero-jekyll-theme
redis
redis-rails
rubocop-rails
@ -698,17 +568,13 @@ DEPENDENCIES
safe_yaml!
sassc-rails
selenium-webdriver
share-to-fediverse-jekyll-theme
sourcemap
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
stackprof
sucker_punch
sutty-donaciones-jekyll-theme
sutty-jekyll-theme
sutty-liquid (>= 0.7.3)
sutty-minima
symbol-fstring
terminal-table
timecop

View file

@ -20,6 +20,9 @@ class Design < ApplicationRecord
validates :gem, presence: true, uniqueness: true
validates :description, presence: true
# Trae todos los temas disponibles.
scope :available_themes, -> { where.not(gem: NO_THEMES).pluck(:gem) }
def no_theme?
NO_THEMES.include? gem
end

View file

@ -379,7 +379,7 @@ class Site < ApplicationRecord
end
# Eliminar el theme si no es una gema válida
@configuration.delete('theme') unless theme_available?
@configuration.delete('theme') unless design.no_theme?
# Si estamos usando nuestro propio plugin de i18n, los posts están
# en "colecciones"
@ -390,20 +390,6 @@ class Site < ApplicationRecord
@configuration
end
# Lista los nombres de las plantillas disponibles como gemas,
# tomándolas dinámicamente de las que agreguemos en el grupo :themes
# del Gemfile.
def available_themes
@available_themes ||= Bundler.load.current_dependencies.select do |gem|
gem.groups.include? :themes
end.map(&:name)
end
# Detecta si el tema actual es una gema
def theme_available?
available_themes.include? design&.gem
end
# Devuelve el dominio actual
def self.domain
ENV.fetch('SUTTY', 'sutty.nl')