Use different templateEngineOverride values for different pages in a pagination set #4062
Replies: 9 comments
-
|
Hm,in shell you would likely use tee for that. Here's an approach using writableStreams: https://github.com/jb55/node-tee (albeit needs an update regarding modern expressions) |
Beta Was this translation helpful? Give feedback.
-
|
Hey @zachleat This way you could have a single point to render different formats from. I imagine something along the lines of what istanbul.js is doing (I recall them having better docs on how to write a custom reporter - or did I confuse it with karma?) This way, people could come up with weird ideas. Like https://jsonfeed.org/ WDYT? |
Beta Was this translation helpful? Give feedback.
-
|
Hmm @Ryuno-Ki I’m not sure what you mean—can you elaborate? What would the standard JSON format represent? |
Beta Was this translation helpful? Give feedback.
-
|
Okay, then let me explain it in more detail. First off, I'm coming from an MVC background (Ruby on Rails, Django etc). There, in a view method, you would compute a context object and pass it to a template. This way you render the output format (e.g. HTML or JSON or LaTeX or who-knows). My mental model was now like this:
I assume that you compute some kind of context object from the markdown files and data dir. Then passing each of those to the specified layout (either set in frontmatter or data dir - at this point likely doesn't matter). What about allowing to hook into the computed context object? It would need to be well defined. Then ... renderers could pick those context objects up and treat them like they please (e.g. passing it to a layout file, change the type of the layout template language or so). It's something I liked on harp.js. Harp.js can even be used as middleware to express.js! But being able to make network requests at build time + layout hierarchy are niiicee also :-) |
Beta Was this translation helpful? Give feedback.
-
|
Maybe would allow things like #488 as well. |
Beta Was this translation helpful? Give feedback.
-
|
Hm, or I am thinking too far ahead. What about working together with HTMLx instead? You're already supporting quite some template languages... |
Beta Was this translation helpful? Give feedback.
-
|
Just FYI, the next large feature on the roadmap is #117 which will decentralize the template language support from Eleventy core, allowing plugins to add their own custom extensions and support template languages. But let me stew on what you’ve said here a bit more. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, I can see, how this would play into what I envisioned. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Reported by @zcorpan
https://twitter.com/zcorpan/status/1113803186693971970
(There may be a better way to do this, open to ideas)
Beta Was this translation helpful? Give feedback.
All reactions