Add page title to <header> <title>
This commit is contained in:
parent
1dae8e2254
commit
083abc5ef1
2 changed files with 5 additions and 1 deletions
|
@ -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"
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue