L
L
lorentso2021-08-09 11:44:24
JavaScript
lorentso, 2021-08-09 11:44:24

Is it possible to export variables from .pug to .js, and back from js files to pug?

Is it possible to export variables from .pug to .js, and back from js files to pug? And if so, how can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lorentso, 2021-08-09
@lorentso

There is an extremely crutch and dray method of solution, which I would not like to resort to. You can simply include an include not only in its intended place, but in parallel with this in another include, which will be hidden at the top level of the page in a block with display none. This way, duplicate markup will not end up on the page, and the variables will affect any selected block.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question