Skip to content

Commit

Permalink
Enable custom title for admin panel - Fixes #1329 (#1330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bramjetten authored Oct 19, 2023
1 parent d83f18a commit 3b38631
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/layouts/spina/admin/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<link rel="icon" href="<%= image_url('spina/favicon.png') %>" />

<title>Spina CMS</title>
<title><%= Spina.config.backend_title %></title>

<!-- Stylesheets -->
<%= stylesheet_link_tag "spina/tailwind", "spina/fonts", "spina/animate", "data-turbo-track": "reload" %>
Expand Down
5 changes: 5 additions & 0 deletions lib/generators/spina/templates/config/initializers/spina.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# All locales your content should be available in.
# Defaults to I18n.default_locale
# config.locales = [:en, :nl]

# Backend title
# ===============
# Set <title> for the admin panel. Defaults to "Spina CMS"
# config.backend_title = "Spina CMS"

# Backend path
# ===============
Expand Down
2 changes: 2 additions & 0 deletions lib/spina.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module Spina
config_accessor :api_key,
:api_path,
:authentication,
:backend_title,
:backend_path,
:importmap,
:frontend_parent_controller,
Expand All @@ -44,6 +45,7 @@ module Spina
self.api_key = nil
self.api_path = "api"
self.authentication = "Spina::Authentication::Sessions"
self.backend_title = "Spina CMS"
self.backend_path = "admin"
self.disable_frontend_routes = false
self.disable_decorator_load = false
Expand Down
5 changes: 5 additions & 0 deletions test/dummy/config/initializers/spina.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# ===============
# All locales your content should be available in.
config.locales = [:en, :nl, :de]

# Backend title
# ===============
# Set <title> for the admin panel. Defaults to "Spina CMS"
# config.backend_title = "Spina CMS"

# Backend path
# ===============
Expand Down

0 comments on commit 3b38631

Please sign in to comment.