9/7/2023 0 Comments Pug template comments![]() ![]() (Alternatively, the child template could override content altogether.) //- sub-layout.pug extends layout.pug block content. As it shows, content now exposes a sidebar and primary block for overriding. It’s also possible to override a block to provide additional blocks, as shown in the following example. - page-a.pug extends layout.pug block scripts script ( src = '/jquery.js' ) script ( src = '/pets.js' ) block content h1 = title - var pets = Įach petName in pets include pet.pug //- pet.pug p = petName ![]() pug is automatically appended to the file name.) Then, define one or more blocks to override the parent block content.īelow, notice that the foot block is not redefined, so it will use the parent’s default and output “some footer content”. To extend this layout, create a new file and use the extends directive with a path to the parent template. - layout.pug html head title My Site - # block scripts script ( src = '/jquery.js' ) body block content block foot #footer p some footer content The example below defines block scripts, block content, and block foot. Providing default content is purely optional, though. Pug blocks can provide default content, if appropriate. In a template, a block is simply a “block” of Pug that a child template may replace. Template inheritance works via the block and extends keywords. Var upload = multer()ĭocument.Pug supports template inheritance. ![]() cb(null, path.join(_dirname + './public/uploads')) Ĭb(null, Date.now() + file.originalname) } Index.js var express = require('express') I try reducing the sise but did not work. Basically, the image have been uploaded fine as I see it in uploads, and even in the img(src"") I can see it as I right click and search the property but the image is not coming out, i.e is not displaying from the sketch box. Please I need help for my client demand this work in 3 days and I am stuck with displaying image in pug template. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |