Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Official Eleventy v3.0 Template Language plugins: ✅ Handlebars, ✅Mustache, ✅ EJS, ✅ Haml, 👀 Pug #3124

Closed
zachleat opened this issue Dec 18, 2023 · 25 comments
Labels
breaking-change This will have to be included with a major version as it breaks backwards compatibility. needs-documentation Documentation for this issue/feature is pending!

Comments

@zachleat
Copy link
Member

zachleat commented Dec 18, 2023

Past discussion: #3074 and #1103

Please upvote the following comments for each of these languages to vote for their continued survival as an officially supported plugin:

@zachleat zachleat added the breaking-change This will have to be included with a major version as it breaks backwards compatibility. label Dec 18, 2023
@zachleat zachleat added this to the Eleventy 3.0.0 milestone Dec 18, 2023
@zachleat
Copy link
Member Author

Handlebars

@zachleat
Copy link
Member Author

Mustache

@zachleat
Copy link
Member Author

EJS

@zachleat
Copy link
Member Author

Haml

@zachleat zachleat changed the title Eleventy v3.0 Template Syntax plugin upvote thread: Handlebars, Mustache, EJS, Haml Eleventy v3.0 Template Syntax plugin voting thread: Handlebars, Mustache, EJS, Haml Dec 18, 2023
@Snapstromegon
Copy link
Member

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

@zachleat
Copy link
Member Author

zachleat commented Jan 4, 2024

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

@Aankhen
Copy link

Aankhen commented Jan 4, 2024

Does Haml stand in for Pug here?

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

@Zearin
Copy link
Contributor

Zearin commented Jan 7, 2024

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

@uncenter
Copy link
Contributor

uncenter commented Jan 9, 2024

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

@Denperidge
Copy link

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

@Zearin
Copy link
Contributor

Zearin commented Jan 18, 2024

@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

@uncenter
Copy link
Contributor

uncenter commented Jan 18, 2024

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

@Zearin
Copy link
Contributor

Zearin commented Jan 18, 2024

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.

@artemkolinko
Copy link

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?

@Snapstromegon
Copy link
Member

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
}

@dwhieb
Copy link

dwhieb commented Apr 12, 2024

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!

@zachleat
Copy link
Member Author

Fwiw a warning did ship in alpha.6!

@zachleat
Copy link
Member Author

zachleat commented Jul 9, 2024

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
Copy link
Member Author

zachleat commented Jul 9, 2024

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

@zachleat zachleat changed the title Eleventy v3.0 Template Syntax plugin voting thread: Handlebars, Mustache, EJS, Haml Official Eleventy v3.0 Template Language plugins: Handlebars, Mustache, EJS, Haml Jul 9, 2024
@zachleat zachleat changed the title Official Eleventy v3.0 Template Language plugins: Handlebars, Mustache, EJS, Haml Official Eleventy v3.0 Template Language plugins: ✅ Handlebars, Mustache, ✅ EJS, Haml, Pug Jul 9, 2024
@zachleat zachleat changed the title Official Eleventy v3.0 Template Language plugins: ✅ Handlebars, Mustache, ✅ EJS, Haml, Pug Official Eleventy v3.0 Template Language plugins: ✅ Handlebars, Mustache, ✅ EJS, ☠️ Haml, Pug Jul 9, 2024
@zachleat zachleat changed the title Official Eleventy v3.0 Template Language plugins: ✅ Handlebars, Mustache, ✅ EJS, ☠️ Haml, Pug Official Eleventy v3.0 Template Language plugins: ✅ Handlebars, ✅Mustache, ✅ EJS, ✅ Haml, 👀 Pug Jul 10, 2024
@zachleat
Copy link
Member Author

zachleat commented Jul 10, 2024

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

@zachleat
Copy link
Member Author

Pug work is ongoing here: #3081

zachleat added a commit that referenced this issue Jul 10, 2024
@zachleat zachleat added the needs-documentation Documentation for this issue/feature is pending! label Jul 10, 2024
zachleat added a commit to 11ty/eleventy-upgrade-help that referenced this issue Jul 23, 2024
zachleat added a commit to 11ty/eleventy-upgrade-help that referenced this issue Jul 23, 2024
@AasimFarooqi
Copy link

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?

@zachleat
Copy link
Member Author

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.

@AasimFarooqi
Copy link

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.

@Aankhen
Copy link

Aankhen commented Jul 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will have to be included with a major version as it breaks backwards compatibility. needs-documentation Documentation for this issue/feature is pending!
Projects
None yet
Development

No branches or pull requests

9 participants