Search code examples
htmlpug

Is it possible to use a .pug file as an include for a section in index.html?


I just found out about .pug and thought maybe its possible to include one .pug file with some functionality in an old HTML, CSS, JS project, without converting the index.html to pug.

I want to create a fancy timeline for a website using pug, scss and swiper, but the site is already created in HTML, CSS and JS.


Solution

  • You could always copy the old web site to the static folder and serve it from there with no changes. However, any page that gets rendered by pug has to be run through the res.render in node/express.

    If you want to use pug for part of your index.html the answer to your question is "no, it can't be done without reworking the index.html page"