From 29d34ee41a0df1d0425bff41a3d5aa185e3d835f Mon Sep 17 00:00:00 2001 From: noracato Date: Fri, 11 Oct 2024 15:56:08 +0200 Subject: [PATCH] Use HAML instead of erb --- Gemfile | 3 +++ Gemfile.lock | 7 +++++++ app/views/layouts/application.html.erb | 23 ----------------------- app/views/layouts/application.html.haml | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 23 deletions(-) delete mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/application.html.haml diff --git a/Gemfile b/Gemfile index b0b0f02..1e62f82 100644 --- a/Gemfile +++ b/Gemfile @@ -25,6 +25,9 @@ gem "jbuilder" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] # gem "bcrypt", "~> 3.1.7" +# Views +gem 'haml' + # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ windows jruby ] diff --git a/Gemfile.lock b/Gemfile.lock index f4e5f1b..bb8e64a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -92,6 +92,10 @@ GEM erubi (1.13.0) globalid (1.2.1) activesupport (>= 6.1) + haml (6.3.0) + temple (>= 0.8.2) + thor + tilt i18n (1.14.6) concurrent-ruby (~> 1.0) importmap-rails (2.0.2) @@ -258,7 +262,9 @@ GEM stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.1) + temple (0.10.3) thor (1.3.2) + tilt (2.3.0) timeout (0.4.1) turbo-rails (2.0.10) actionpack (>= 6.0.0) @@ -290,6 +296,7 @@ DEPENDENCIES bootsnap brakeman debug + haml importmap-rails jbuilder mysql2 (~> 0.5) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index d0f57ed..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - - - - <%= content_for(:title) || "My Etm" %> - - - <%= csrf_meta_tags %> - <%= csp_meta_tag %> - - <%= yield :head %> - - - - - - <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> - <%= javascript_importmap_tags %> - - - - <%= yield %> - - diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml new file mode 100644 index 0000000..1adc7a7 --- /dev/null +++ b/app/views/layouts/application.html.haml @@ -0,0 +1,18 @@ +!!! 5 +%html{:lang => 'en'} + %head + %title= content_for(:title) || "ETM" + %meta{ name: "viewport", content: "width=device-width,initial-scale=1"} + %meta{ name: "apple-mobile-web-app-capable", content: "yes"} + = csrf_meta_tags + = csp_meta_tag + + = yield :head + + %link{ rel:"manifest", href:"/manifest.json" } + + = stylesheet_link_tag "application", "data-turbo-track": "reload" + = javascript_importmap_tags + + %body + = yield