Reputation: 1555
Is there a way to add to the page title with js and pug, if I for example have a layout file with pug, which sets the page title to, say Aero -
And in the pug file extending the layout file, I want to append a string to that page title with something else, so it would display Aero - The added string.
Is this possible with some sort of interpolation?
Upvotes: 3
Views: 2655
Reputation: 76
You can do something like that:
title Aero #{addedString}
meta(name='description', content="Aero" + addedStringDescription)
meta(property='og:title', content= "Aero" + addedString)
Upvotes: 1
Reputation: 1534
You can try using the block append functionality of pug.
In the layout.pug:
html
head
block head
title= 'Aero'
body
block content
In the template.pug:
extends layout.pug
block append head
title= title + 'The added string'
Upvotes: 1