Skip to content

Commit cd4700d

Browse files
committed
Merge branch 'engine-removal-note' of github.com:Snapstromegon/eleventy into Snapstromegon-engine-removal-note
2 parents db06e76 + 96c7166 commit cd4700d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Engines/TemplateEngineManager.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ class TemplateEngineManager {
7474
return !!this.getClassNameFromTemplateKey(name);
7575
}
7676

77+
isEngineDeprecated(name) {
78+
return ["ejs", "hbs", "mustache", "haml", "pug"].includes(name) && !this.hasEngine(name);
79+
}
80+
7781
async getEngineClassByExtension(extension) {
7882
// We include these as raw strings (and not more readable variables) so they’re parsed by a bundler.
7983
if (extension === "md") {
@@ -99,6 +103,14 @@ class TemplateEngineManager {
99103
}
100104

101105
async getEngine(name, extensionMap) {
106+
// Warning about engine deprecation
107+
// TODO: error message needs updating once issue is closed
108+
if (this.isEngineDeprecated(name)) {
109+
throw new Error(
110+
`Per our community survey, the "${name}" template syntax was removed from core in 11ty v3.0. Read more https://github.com/11ty/eleventy/issues/3124 including our plans to expose these as official plugins (outside of core). You can implement these yourself using https://www.11ty.dev/docs/languages/custom/`,
111+
);
112+
}
113+
102114
if (!this.hasEngine(name)) {
103115
throw new Error(`Template Engine ${name} does not exist in getEngine()`);
104116
}

0 commit comments

Comments
 (0)