N
N
ne_pes2019-04-03 22:30:06
JavaScript
ne_pes, 2019-04-03 22:30:06

Why is it throwing an error due to a condition in PUG?

When I do the condition, it gives an error, what's the problem?

block variables 

doctype html
html(lang="ru")
    head
        meta(charset="UTF-8")
        meta(name="viewport", content="width=device-width, initial-scale=1.0")
        meta(http-equiv="X-UA-Compatible", content="ie=edge")
        link(rel="stylesheet", href="css/style.css?v2")
        link(rel="stylesheet", href="css/animate.css")
        title=pageTitle

    body
        include ../modules/header

        block content

        if(peremen)
            include ../modules/footer

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Gelever, 2019-04-09
@gelbman20

../modules/headerDo you have files ../modules/footeravailable?
Also you need to make extendsthis file in another file. That is, put this code in a file and do it _skeleton.pugalready in the file When the condition is true When false (the variable is not defined)index.pugextends _skeleton
5cac531fb6161752660230.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question