Add page title to <header> <title>

This commit is contained in:
Edward Loveall 2021-09-04 14:44:05 -04:00
parent 1dae8e2254
commit 083abc5ef1
No known key found for this signature in database
GPG Key ID: 789A4AE983AC8901
2 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,7 @@ class Shared::LayoutHead < BaseComponent
def render
head do
utf8_charset
title "My App - #{@page_title}"
title @page_title || "Scribe"
css_link asset("css/app.css"), data_turbolinks_track: "reload"
js_link asset("js/app.js"), defer: "true", data_turbolinks_track: "reload"
meta name: "turbolinks-cache-control", content: "no-cache"

View File

@ -1,6 +1,10 @@
class Articles::ShowPage < MainLayout
needs page : Page
def page_title
page.title
end
def content
h1 page.title
if subtitle = page.subtitle