mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
3b60832214
- 500.html generated with admin-set default locale if set - Error page `<title>` includes Mastodon site title - 500 title changed to "This page is not correct" (ref: <https://www.youtube.com/watch?v=2VCAP_seh1A>) - 500 content appended with "on our end" to make clear it's not user's fault
19 lines
505 B
Ruby
19 lines
505 B
Ruby
# frozen_string_literal: true
|
|
|
|
namespace :assets do
|
|
desc 'Generate 500.html'
|
|
task :generate_500 do
|
|
I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do
|
|
html = ApplicationController.render('errors/500', layout: 'error')
|
|
File.write(Rails.root.join('public', '500.html'), html)
|
|
end
|
|
end
|
|
end
|
|
|
|
if Rake::Task.task_defined?('assets:precompile')
|
|
Rake::Task['assets:precompile'].enhance do
|
|
Webpacker::Manifest.load
|
|
Rake::Task['assets:generate_500'].invoke
|
|
end
|
|
end
|