5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-09-21 07:42:05 +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 'ed25519'
gem 'bcrypt_pbkdf' 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 group :production do
gem 'lograge' gem 'lograge'
end end

View file

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

View file

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

View file

@ -379,7 +379,7 @@ class Site < ApplicationRecord
end end
# Eliminar el theme si no es una gema válida # 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 # Si estamos usando nuestro propio plugin de i18n, los posts están
# en "colecciones" # en "colecciones"
@ -390,20 +390,6 @@ class Site < ApplicationRecord
@configuration @configuration
end 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 # Devuelve el dominio actual
def self.domain def self.domain
ENV.fetch('SUTTY', 'sutty.nl') ENV.fetch('SUTTY', 'sutty.nl')