mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 07:11:42 +00:00
fix: informar cuando la plantilla no tiene gema #14309
This commit is contained in:
parent
ae72297adf
commit
de59cd9f34
3 changed files with 16 additions and 0 deletions
|
@ -91,6 +91,15 @@ module Jekyll
|
|||
spec.name == name
|
||||
end
|
||||
|
||||
unless spec
|
||||
I18n.with_locale(locale) do
|
||||
raise ArgumentError, I18n.t('activerecord.errors.models.site.attributes.design_id.missing_gem', theme: name)
|
||||
rescue ArgumentError => e
|
||||
ExceptionNotifier.notify_exception(e, data: { theme: name, site: site.path })
|
||||
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
|
||||
|
|
|
@ -191,6 +191,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}."
|
||||
|
|
|
@ -191,6 +191,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}.'
|
||||
|
|
Loading…
Reference in a new issue