D
D
Dymok2018-03-29 17:16:29
Pug
Dymok, 2018-03-29 17:16:29

Why doesn't extends work in Pug?

I'm trying to repeat the example from the documentation with redefining the contents of the block, but the error constantly falls out

Only named blocks and mixins can appear at the top level of an extending template

Here is the code:
//index.pug

extends  ../parts/head

block title1
  title Test

body
  include ../parts/right_menu

//head.pug

doctype html
html
  head
    block title
      title Home - Elegant
    link(rel="stylesheet" type="text/css" href = "../css/main.css")
    link(rel="stylesheet" type="text/css" href = "../css/normalize.css")
    meta(name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1")

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question