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

View file

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