fix: Use page_title with fallback to name for portal display titles (#13719)
This commit is contained in:
@@ -68,6 +68,10 @@ class Portal < ApplicationRecord
|
||||
self[:color].presence || DEFAULT_COLOR
|
||||
end
|
||||
|
||||
def display_title
|
||||
page_title.presence || name
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def config_json_format
|
||||
|
||||
@@ -34,7 +34,7 @@ By default, it renders:
|
||||
<% if content_for?(:head) %>
|
||||
<%= yield(:head) %>
|
||||
<% else %>
|
||||
<title><%= @portal.page_title%></title>
|
||||
<title><%= @portal.display_title %></title>
|
||||
<% end %>
|
||||
|
||||
<% if @portal.logo.present? %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% if !@is_plain_layout_enabled %>
|
||||
<% content_for :head do %>
|
||||
<title><%= @portal.name %></title>
|
||||
<meta name="title" content="<%= @portal.name %>">
|
||||
<title><%= @portal.display_title %></title>
|
||||
<meta name="title" content="<%= @portal.display_title %>">
|
||||
|
||||
<% if @og_image_url.present? %>
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% content_for :head do %>
|
||||
<title><%= @article.title %> | <%= @portal.name %></title>
|
||||
<title><%= @article.title %> | <%= @portal.display_title %></title>
|
||||
<% if @article.meta["title"].present? %>
|
||||
<meta name="title" content="<%= @article.meta["title"] %>">
|
||||
<meta property="og:title" content="<%= @article.meta["title"] %>">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% content_for :head do %>
|
||||
<title><%= @category.name %> | <%= @portal.name %></title>
|
||||
<meta name="title" content="<%= @category.name %> | <%= @portal.name %>">
|
||||
<title><%= @category.name %> | <%= @portal.display_title %></title>
|
||||
<meta name="title" content="<%= @category.name %> | <%= @portal.display_title %>">
|
||||
<% if @category.description.present? %>
|
||||
<meta name="description" content="<%= @category.description %>">
|
||||
<meta property="og:description" content="<%= @category.description %>">
|
||||
|
||||
Reference in New Issue
Block a user