Answer the question
In order to leave comments, you need to log in
How to do a line break in PUG (Jade) code?
I create an array in PUG
Если писать все в 1 строку:
- var app = [{demoImg : 'images/App_L.jpg',basic: ['HTML','SASS', 'Jquery'], libraries: ['Font Awesome', 'Scrollreveal.js', 'Section-scroll.js', 'Slick.js'], assembly: ['Gulp', 'Bower']},{demoImg : 'images/lambdaApp_L.jpg',basic: ['HTML','SASS', 'Jquery'], libraries: ['Font Awesome', 'Scrollreveal.js', 'Section-scroll.js', 'Slick.js'], assembly: ['Gulp', 'Bower']}];
то компилируется и работает.
Если попытаться облагородить код:
- var app = [
{
demoImg : 'images/lambdaApp_L.jpg',
basic: ['HTML','SASS', 'Jquery'],
libraries: ['Font Awesome', 'Scrollreveal.js', 'Section-scroll.js', 'Slick.js'],
assembly: ['Gulp', 'Bower'],
}
];
выдает ошибку - "unexpected text {"
Answer the question
In order to leave comments, you need to log in
See "Block unbuffered code" example: https://pugjs.org/language/code.html#unbuffered-code
Alternatively
// Multi-line entry
-
menu = [
{
href: '#main',
page: 'Main'
},
{
page: "Directory",
href: "#",
sub: [
{
href: "#2",
page : "Submenu 1"
},
{
href: "#3",
page: "Submenu 2"
},
{
href: "#4",
page: "Submenu 3"
}
]
},
{
href: "#about",
page : "About Us"
},
{
href: "https://mediarama.by/ ",
page: "Website development"
},
{
href: "#contacts",
page: "Contacts"
}
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question