Search code examples
javascripthtmlpug

Set HTML page title with js and pug


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?


Solution

  • You can do something like that:

     title Aero #{addedString}
     meta(name='description', content="Aero" + addedStringDescription)
     meta(property='og:title', content= "Aero" + addedString)