E
E
evilpython2019-09-06 14:37:06
HTML
evilpython, 2019-09-06 14:37:06

PUG - import code into another pug file at specified location?

Tell me, is it possible to implement such a thing in PUG:
Let's say I have two pug files, but the code contained in them must be inside one section.
For example, in the first file I have a header with some code, and in the second I have another code, which, when compiled, should be inside the header from the first file.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yan Markov, 2019-09-06
@mroforolhc

Main file:

doctype html
html(lang="ru")
    head
        include templates/head.pug

    body     
        include templates/header.pug
        // туть ваши крутые блоки
        include templates/footer.pug

And in the templates folder you already create files.
Tip: smoke the documentation: https://pugjs.org/language/includes.html
No one will answer you for more details than there.

L
Lord_Dantes, 2019-09-06
@Lord_Dantes

In the file, include the header, and in the header file, include the file that needs to be.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question