basright.blogg.se

How to troubleshoot pug template not rendering
How to troubleshoot pug template not rendering





how to troubleshoot pug template not rendering

div(class="main container-fluid text-center")Ĭanvas(id="chartPic" width="400" height="400") Heres the step-by-step: In the Settings menu, go to Downloads and find Content Libraries (at the top).

HOW TO TROUBLESHOOT PUG TEMPLATE NOT RENDERING CODE

You need to pass the color values as a string (unless they are predefined variables)Īlso, you should probably wrap the chart generating code inside a window onload event to make sure the code doesn't get executed before the chart.js script is loaded successfully. The example below defines block scripts, block content. Providing default content is purely optional, though.

how to troubleshoot pug template not rendering

Next, create a sub-directory inside the root directory for keeping. pug, you would likely write something like this: - const mappings require./cssModules. In this section we will have a quick look at Pug, a high-performance HTML templating engine, and do away with loading of HTML files. Open the gulpfile.js and write the following task: var gulp require ('gulp'), pug require ('gulp-pug') // run this task by typing in gulp pug in CLI. json file in the same folder, and you want to require. This is where we are going to assign the command that gulp will use to understand our pug file in the templates folder and compile it to a new build folder. To do this we are going to use the package gulp-merge-json.

how to troubleshoot pug template not rendering

The first thing we are going to do is set up a separate task to iterate through our data files, set our namespaces, and generate our merged JSON. Pug blocks can provide default content, if appropriate. Passing require to pug templates has one issue while requiring local files. Pass the merged JSON into gulp-pug to render our Pug templates. In a template, a block is simply a block of Pug that a child template may replace. This could sometimes be an indenting issue or an unquoted attribute, although rare. If there are problems, use the HTML template as a reference to figure out what could have caused the problem. There's a syntax error! You need to put, after the end of data objectĢ. Template inheritance works via the block and extends keywords. Run the server to check that there are no problems with how the Pug template is rendered.







How to troubleshoot pug template not rendering