eleventy
eleventy copied to clipboard
Eleventy v3.0 Template Syntax plugin voting thread: Handlebars, Mustache, EJS, Haml
Past discussion: https://github.com/11ty/eleventy/pull/3074 and https://github.com/11ty/eleventy/issues/1103
Please upvote the following comments for each of these languages to vote for their continued survival as an officially supported plugin:
Handlebars
Mustache
EJS
Haml
Can we warn users in the alphas about this change and link them here? E.g. if someone uses Handlebars in the alpha, they could get a message like "Hey, you're using Handlebars and we're thinking about removing it as a build in language. If you want to have a say on this, look at this issue: ".
Fwiw, all of these languages (and Pug) are not currently in the alpha releases. A warning would be good, yeah!
Does Haml stand in for Pug here?
EDIT: Sorry, I just saw the ‘(and Pug)’. I guess my pet is safe!
@Aankhen Alas, Pug is not going to be bundled in Eleventy v3. :( However, there is an Issue (#3081) tracking work to get a working plugin for Pug in v3. If we can pull it off and do a good job, it might be officially supported.
Send me a note if you’re interested in collaborating on a Pug plugin for Eleventy v3. I’ve messed around on my own, but the only success I’ve had so far is in overcoming some further-from-success errors only to arrive at slightly-closer-to-success errors.
I thought there was going to be an official @11ty/pug plugin?
I'm also here to show support for - and maybe help with the development of (if @Zearin still needs or wants support) - an official pug plugin! Pug is my beloved and I will die on this hill
@uncenter @Denperidge @Aankhen:
Zach gave me the go-ahead to start on an officially supported Eleventy v3 plugin for Pug. Here it is:
https://github.com/Zearin/eleventy-plugin-pug
P.S. – I code weird. I hate semicolons. You have been warned. P.P.S. – I’m a much better editor than a writer—or whatever the equivalent is for coding. Wanna collaborate? :D P.P.P.S. – Ah, you’ll figure it out :P
Thoughts on @11ty/pug
for the package name instead of the longer and repetitive @11ty/eleventy-plugin-pug
? Maybe @11ty/plugin-pug
?
What you’re saying makes sense, but I was just going along with the precedent of most existing plugin names. I dunno.
If its name needs to change before the first official release, that’s okay.
Hi, I'm using the ejs template engine in my project. And now I want to try to switch to version 3, but, as far as I understand, in version 3 this was removed from the core. So, how can I connect this template engine separately?
Hi @artemkolinko, I think you should find what you need here in the docs for custom languages: https://www.11ty.dev/docs/languages/custom/
If you have any more questions or this is not helpful for you, feel free to respond with further questions.
I also don't know if maybe someone already created a plugin for 11ty 3 for ejs support.
From what I can tell at a quick glance, you should be able to add something like this to your config:
const ejs = require("ejs");
module.exports = function(eleventyConfig) {
eleventyConfig.addExtension("ejs", {
compile: (inputContent) => ejs.compile(inputContent),
});
// more config
}
Fwiw, all of these languages (and Pug) are not currently in the alpha releases. A warning would be good, yeah!
Came here trying to figure out why my Handlebars templates wouldn't render in v3.0 alpha, so I'd second the idea of adding a warning!
Fwiw a warning did ship in alpha.6!
Work ongoing here: https://github.com/11ty/eleventy-plugin-template-languages
ejs
has been ported to the alpha
channel and installable via npm install @11ty/eleventy-plugin-ejs
https://github.com/11ty/eleventy-plugin-template-languages/tree/main/ejs
Handlebars is now available https://github.com/11ty/eleventy-plugin-template-languages/tree/main/handlebars
Handlebars, Haml, EJS, and Mustache are now published as plugins, sourced from this repo: https://github.com/11ty/eleventy-plugin-template-languages
Pug work is ongoing here: #3081
EJS has 11.8m users, so it doesn't make sense to drop EJS. Will the EJS plugin which is available for alpha 3 be maintained for future?
Handlebars, Haml, EJS, and Mustache are now published as plugins, sourced from this repo: https://github.com/11ty/eleventy-plugin-template-languages
As noted above, the plugins are already available for prerelease testing.
Actually, I am currently trying to make up my mind about using 11ty for my current project. I have three main concerns. The first was EJS, which, as mentioned above, will be supported in the future. The second is Vite, as I need it for bundling, but I read the community survey and your post about potentially cutting Vite. The third main issue I am facing is form submission; I don't know how to use serverless functions with Netlify or any other functions platform. The only solution I've come up with is using Express as a server for form submission. I spent the whole day researching this, using 11ty with Express and deploying it on Digital Ocean in a single droplet. So this is where I am. Form submission is really important for me, and I am considering not using 11ty at this point, perhaps reserving it for a personal project in the future.
@AasimFarooqi:
The second is Vite, as I need it for bundling, but I read the community survey and your post about potentially cutting Vite.
If it helps, I’ve never used the Vite plugin myself. I’ve always run Vite in parallel with Eleventy, which is reasonably straightforward as long as you remember that the output from one is the input to the other.
The third main issue I am facing is form submission; I don't know how to use serverless functions with Netlify or any other functions platform.
For what it’s worth, Eleventy doesn’t make using serverless functions easier or harder than any other SSG: if you can use them with another tool, you can also use them with Eleventy, since their interface is fixed and small. I’d encourage you to share the details here but I suspect they’re not directly related to Eleventy or EJS, so a new Discussions thread might be more appropriate. (Do tag me if you create one so I don’t miss it.)