Is there a way to use GULP or PUG with netlify for HTML includes

Hello! I’m hosting my website on Netlify and Netlify is awesome! Since Netlify does not support PHP I’m not able to use Include of course, but there are some of the serverless alternatives out there like GULP or PUG includes I just don’t know how to enable PUG or GULP in netlify. Whenever I try to use a command like this: npm install pug-cli; node node_modules/pug-cli/index.js pug/ --out ./public I get a build error

Hey! Welcome to the community, I don’t use these libraries but hopefully can point you in the right direction.

Since Gulp requires node - you probably need to be running these via serverless functions. You can read more about those here:

Regarding trying to use the install pug-cli as a build command and generate the HTML, could you provide your build logs? :slight_smile:

Also, netlify has templates using these technologies, you could investigate those and get some guidance on how they work?

1 Like