mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 09:51: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
|
spec.name == name
|
||||||
end
|
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 = Gem::Version.new(RUBY_VERSION)
|
||||||
ruby_version.canonical_segments[2] = 0
|
ruby_version.canonical_segments[2] = 0
|
||||||
base_path = Rails.root.join('_storage', 'gems', File.basename(site.source), 'ruby',
|
base_path = Rails.root.join('_storage', 'gems', File.basename(site.source), 'ruby',
|
||||||
|
@ -114,6 +123,11 @@ module Jekyll
|
||||||
private
|
private
|
||||||
|
|
||||||
def gemspec; end
|
def gemspec; end
|
||||||
|
|
||||||
|
# @return [Symbol]
|
||||||
|
def locale
|
||||||
|
@locale ||= (site.config['locale'] || site.config['lang'] || I18n.locale).to_sym
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# No necesitamos los archivos de la plantilla
|
# No necesitamos los archivos de la plantilla
|
||||||
|
|
|
@ -191,6 +191,7 @@ en:
|
||||||
deploys:
|
deploys:
|
||||||
deploy_local_presence: 'We need to be build the site!'
|
deploy_local_presence: 'We need to be build the site!'
|
||||||
design_id:
|
design_id:
|
||||||
|
missing_gem: "Site is configured to use %{theme} theme, but the corresponding gem is missing from Gemfile"
|
||||||
layout_incompatible:
|
layout_incompatible:
|
||||||
error: "Design can't be changed because there are posts with incompatible layouts"
|
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}."
|
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:
|
deploys:
|
||||||
deploy_local_presence: '¡Necesitamos poder generar el sitio!'
|
deploy_local_presence: '¡Necesitamos poder generar el sitio!'
|
||||||
design_id:
|
design_id:
|
||||||
|
missing_gem: "El sitio usa la plantilla %{theme} pero la gema correspondiente no se encuentra en el Gemfile"
|
||||||
layout_incompatible:
|
layout_incompatible:
|
||||||
error: 'No se puede cambiar la plantilla porque hay artículos con formatos incompatibles'
|
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}.'
|
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