You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I would like to know if there is a way to implement with a little bit of source code change "lazy mixin call"
For such as:
index.pug
+addStyle("index") // Push into the styles array
doctype html
html
includeinclude/header.pug // Will pull from the array
body
includeinclude/navbar.pug // Push into the array
h1 Some Content
navbar.pug
head
title My Page
+getScripts()
+getStyles()
Mixins.pug
mixin addStyle(stylePath)
- template.addStyle(stylePath)mixin getStyles()
each stylePath intemplate.getStyles()
link(rel="stylesheet"href=stylePath)
Inside my header.pug, I have a function that will transform all added styles into a proper format, the issue is that since the execution of the files are sequential, the navbar, footer (or any other addStyle down the line of the current index) will never be placed inside the header.
Is there a way to implement a "lazy" mixin call such as ~getStyles() that will be executed only at the end of the main execution, so all my addStyles will be registered and THEN the header will be properly populated with all the styles.
The text was updated successfully, but these errors were encountered:
Hello, I would like to know if there is a way to implement with a little bit of source code change "lazy mixin call"
For such as:
index.pug
navbar.pug
Mixins.pug
Inside my header.pug, I have a function that will transform all added styles into a proper format, the issue is that since the execution of the files are sequential, the navbar, footer (or any other addStyle down the line of the current index) will never be placed inside the header.
Is there a way to implement a "lazy" mixin call such as ~getStyles() that will be executed only at the end of the main execution, so all my addStyles will be registered and THEN the header will be properly populated with all the styles.
The text was updated successfully, but these errors were encountered: