5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 22:31:42 +00:00

Merge branch 'issue-14309' into 'rails'
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

fix: informar cuando la plantilla no tiene gema #14309

See merge request sutty/sutty!207
This commit is contained in:
fauno 2023-09-27 20:26:08 +00:00
commit b99abb3a4f
3 changed files with 16 additions and 0 deletions

View file

@ -91,6 +91,15 @@ module Jekyll
spec.name == name
end
unless spec
I18n.with_locale(locale) do
raise Jekyll::Errors::InvalidThemeName, I18n.t('activerecord.errors.models.site.attributes.design_id.missing_gem', theme: name)
rescue Jekyll::Errors::InvalidThemeName => e
ExceptionNotifier.notify_exception(e, data: { theme: name, site: File.basename(site.source) })
raise
end
end
ruby_version = Gem::Version.new(RUBY_VERSION)
ruby_version.canonical_segments[2] = 0
base_path = Rails.root.join('_storage', 'gems', File.basename(site.source), 'ruby',
@ -114,6 +123,11 @@ module Jekyll
private
def gemspec; end
# @return [Symbol]
def locale
@locale ||= (site.config['locale'] || site.config['lang'] || I18n.locale).to_sym
end
end
# No necesitamos los archivos de la plantilla

View file

@ -195,6 +195,7 @@ en:
deploys:
deploy_local_presence: 'We need to be build the site!'
design_id:
missing_gem: "Site is configured to use %{theme} theme, but the corresponding gem is missing from Gemfile"
layout_incompatible:
error: "Design can't be changed because there are posts with incompatible layouts"
help: "Your site has posts with layouts only compatible with the current design. If you change it, the site won't work as you expect. If you're trying out designs, you can delete posts in the following incompatible layouts:: %{layouts}."

View file

@ -195,6 +195,7 @@ es:
deploys:
deploy_local_presence: '¡Necesitamos poder generar el sitio!'
design_id:
missing_gem: "El sitio usa la plantilla %{theme} pero la gema correspondiente no se encuentra en el Gemfile"
layout_incompatible:
error: 'No se puede cambiar la plantilla porque hay artículos con formatos incompatibles'
help: 'En tu sitio hay artículos que solo son compatibles con el diseño actual, si cambias la plantilla el sitio no funcionará como esperas. Si estás probando plantillas, puedes eliminar los artículos en los formatos incompatibles: %{layouts}.'