I am extending a pug layout(parent) to another pug layout(child).I am getting an error 'unexpected token:indent' from the parent layout

81 views Asked by At

This file name is layout.pug(parent):

 doctype html 
 html
   head
     title knowledgebase
   body 
     block content     
     br
     hr
     footer
       p Copyright © 2018

And this file name is index.pug(child):

extends layout
block content
  h1 articles
  h1 #{title}
1

There are 1 answers

0
Graham On

At first I thought everything was good with your code, then I looked closely at what was pasted here.

If inspect the code in layout.pug you'll see that there's a leading space on every line. Make sure that doctype html and html (which are your root elements in the parent template) have ZERO spaces at the start of the line.

Otherwise your code looks good and should work as expected.