eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

Eleventy v3.0 Template Syntax plugin voting thread: Handlebars, Mustache, EJS, Haml

Open zachleat opened this issue 1 year ago • 17 comments

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:

zachleat avatar Dec 18 '23 01:12 zachleat

Handlebars

zachleat avatar Dec 18 '23 01:12 zachleat

Mustache

zachleat avatar Dec 18 '23 01:12 zachleat

EJS

zachleat avatar Dec 18 '23 01:12 zachleat

Haml

zachleat avatar Dec 18 '23 01:12 zachleat

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: ".

Snapstromegon avatar Jan 04 '24 17:01 Snapstromegon

Fwiw, all of these languages (and Pug) are not currently in the alpha releases. A warning would be good, yeah!

zachleat avatar Jan 04 '24 17:01 zachleat

Does Haml stand in for Pug here?

EDIT: Sorry, I just saw the ‘(and Pug)’. I guess my pet is safe!

Aankhen avatar Jan 04 '24 20:01 Aankhen

@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.

Zearin avatar Jan 07 '24 15:01 Zearin

I thought there was going to be an official @11ty/pug plugin?

uncenter avatar Jan 09 '24 02:01 uncenter

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

Denperidge avatar Jan 11 '24 11:01 Denperidge

@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

Zearin avatar Jan 18 '24 00:01 Zearin

Thoughts on @11ty/pug for the package name instead of the longer and repetitive @11ty/eleventy-plugin-pug? Maybe @11ty/plugin-pug?

uncenter avatar Jan 18 '24 00:01 uncenter

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.

Zearin avatar Jan 18 '24 00:01 Zearin

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?

artemkolinko avatar Feb 23 '24 17:02 artemkolinko

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
}

Snapstromegon avatar Feb 23 '24 19:02 Snapstromegon

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!

dwhieb avatar Apr 12 '24 21:04 dwhieb

Fwiw a warning did ship in alpha.6!

zachleat avatar Apr 12 '24 22:04 zachleat

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

zachleat avatar Jul 09 '24 17:07 zachleat

Handlebars is now available https://github.com/11ty/eleventy-plugin-template-languages/tree/main/handlebars

zachleat avatar Jul 09 '24 22:07 zachleat

Handlebars, Haml, EJS, and Mustache are now published as plugins, sourced from this repo: https://github.com/11ty/eleventy-plugin-template-languages

zachleat avatar Jul 10 '24 17:07 zachleat

Pug work is ongoing here: #3081

zachleat avatar Jul 10 '24 17:07 zachleat

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?

AasimFarooqi avatar Jul 28 '24 12:07 AasimFarooqi

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.

zachleat avatar Jul 28 '24 13:07 zachleat

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 avatar Jul 28 '24 14:07 AasimFarooqi

@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.)

Aankhen avatar Jul 30 '24 10:07 Aankhen