N
N
Nikolay Semenov2016-07-24 06:25:16
Pug
Nikolay Semenov, 2016-07-24 06:25:16

How to change page title in jade?

Guys, here's the thing:
I include the following code in the pages:

head
  meta(charset='utf-8')
  title Heading the page
  meta(content='' name='author')
  meta(content='' name='description')
  meta(content='' name='keywords')
  meta(content='width-device-width, initial-scale=1' name='viewport')
  meta(content='ie=edge' http-equiv='x-ua-compatible')
  link(rel='stylesheet' href='css/main.css')

Attention question! How can I change the title for different pages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Khokhlov, 2016-07-24
@andrhohlov

Don't include
_layout.jade

doctype html
html(lang="ru-RU" class="no-js")
  head
    meta(charset="utf-8")
    title= pageTitle || ""
  body
    block content

page.jade
extends layouts/_default
- pageTitle = 'Title';
block content
  // content

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question