7
7
7GIT2020-11-15 17:32:55
Pug
7GIT, 2020-11-15 17:32:55

How to include pages in a page that inherits a template in PUG?

When getting to know pug, there was a problem:
I can't include pages in index.pug, which inherits the main.pug template.
I'm looking for advice on what approach is correct for development / layout:
1. In index.pug, write a commented list of pages in order to work with one of them (well, you understand, I hope), you uncommented with which you work.
2. In layout/main.pug, add a commented out list of pages and make it an index page.

The error says it's not the right way, but I've already prescribed it for everyone. Help.

Mistake
[16:07:03] Plumber found unhandled error:
Error in plugin "gulp-pug"
Message:
ENOENT: no such file or directory, open 'D:\program ssd\openserver\domains\_dev\dev\pages\home.pug'
at D:\program ssd\openserver\domains\_dev\dev\pug\index.pug line 8
Details:
errno: -4058
syscall: open
code: ENOENT
path: D:\program ssd\openserver\domains\_dev\dev\pages\home.pug


ges5p0epqv-nv6sqicp3z-iwiha.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2020-11-15
@7GIT

It is not very clear why this is to include the entire page, and it is contrary to common sense.
include is designed to include individual blocks, not the entire page along with the entire structure. Keep pluggable content separate from pages, plug it into pages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question