question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

How to pass template engine options?

See original GitHub issue

Iā€™m trying to use eleventy with pug and would like to pass custom render options. Iā€™m asking this because I canā€™t even make it work, as Iā€™d like to use includes with relative paths. Pug throws me this error: Error: the "filename" option is required to use includes and extends with "relative" paths

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zachleatcommented, Feb 20, 2018

This will be included with Eleventy 0.2.15! Support and tests added šŸ‘

New Pug features are docā€™d here: https://github.com/11ty/eleventy/#template-engine-features allows you to configure any pug compile/render options you want.

1reaction
cfviotticommented, Feb 16, 2018

@kleinfreund Sure, I might even say it wasnā€™t clear enough for me on how to structure my project and how to use includes and extends properly.

Hereā€™s my project structure: image

This is my .eleventy.js file: image

And I have a include section-card.pug inside the section-about.pug file for example.

The relevant error lines eleventy throws me back are:

Eleventy:Template Template.render is bypassing wrapping content in layouts for './src/views/includes/section-about.pug'. +17ms
  Eleventy:Template ./src/views/includes/section-about.pug renderContent() using pug +0ms

Problem writing eleventy templates: 
Error: the "filename" option is required to use includes and extends with "relative" paths
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using template engines with Express
Express-compliant template engines such as Jade and Pug export a function named __express(filePath, options, callback) , which is called by the res.render()Ā ...
Read more >
How to pass options into Express template engine?
How to pass options into Express template engine? Ā· Try :: app.set('view engine', 'ejs'); app.locals.async = true; Ā· @ŞivāSankĂr Hmm. ThatĀ ...
Read more >
Top Express.js template engines for dynamic HTML pages
There are a number of template engines available today, and the more popular ones include Pug (fka Jade), Handlebars, EJS, Mustache, Swig, andĀ ......
Read more >
Understanding Express Template Engines | DigitalOcean
A brief introduction into various template engines you can use in Node.js and Express. We'll go over Pug, EJS and Mustache.
Read more >
Using EJS Template Engine With Express.js - Topcoder
Template Engines and EJS: Ā· Setting up a project Ā· Configuring server.js to use EJS Ā· Creating EJS partials Ā· Using partials in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found