edheltzel / flightdeck-esbuild

⚔️ WIP: 🚀 Flightdeck – 11ty starter project that is highly opinionated using esbuild and lightningcss
Do What The F*ck You Want To Public License
1 stars 0 forks source link

macros are broken unless import is manually added #6

Closed edheltzel closed 1 year ago

edheltzel commented 2 years ago

macros will cause 11ty to error in the console and not rebuild due to how 11ty handles nunjuck template inheritance which is slightly different than "vanilla" Nunjucks.

Ideally, there would be a global import so macros would only need to use a single import for all components that live under the components/ directory.

{% from 'macros/component.njk' import component %}

<!-- component usage -->
{{ component('blockquote', {
  text:'This is a blockquote using a <strong>macro</strong>',
  source: '<a href="https://github.com/11ty/eleventy/issues/613">Issue #613</a>'}) }}

This is only an attempt to keep everything in the spirit of Flightdeck, where Eleventy is at the helm with the least amount of friction for the developer experience.

edheltzel commented 2 years ago

https://github.com/11ty/eleventy/issues/613

edheltzel commented 1 year ago

possible solution: https://github.com/11ty/eleventy/issues/613#issuecomment-999637109

Going to shelf this issue and add it to the roadmap as an 11ty plugin