-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade WebC plugin for Eleventy core v3.0. Changes to use the bundle…
…d with core Bundle Plugin. Updates tests to use ESM (still CJS on plugin code)
- Loading branch information
Showing
18 changed files
with
146 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"editor.trimAutoWhitespace": false, | ||
"files.trimTrailingWhitespaceInRegexAndStrings": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,7 @@ | ||
const EleventyWebcPlugin = require("../../eleventyWebcPlugin.js"); | ||
const { RetrieveGlobals } = require("node-retrieve-globals"); | ||
|
||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.addPlugin(EleventyWebcPlugin, { | ||
components: false, | ||
}); | ||
|
||
// via https://github.com/11ty/demo-eleventy-js-front-matter | ||
eleventyConfig.setFrontMatterParsingOptions({ | ||
engines: { | ||
"javascript": function(frontMatterCode) { | ||
let vm = new RetrieveGlobals(frontMatterCode); | ||
|
||
let data = {}; // want to pass in data available in front matter? | ||
return vm.getGlobalContext(data, { | ||
reuseGlobal: true, | ||
dynamicImport: true, | ||
}); | ||
} | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
---javascript | ||
---js | ||
const frontmatterdata = "HELLO FROM FRONT MATTER"; | ||
--- | ||
<span>{{ frontmatterdata }}</span> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import WebcPlugin from "../../eleventyWebcPlugin.js"; | ||
import { RenderPlugin } from "@11ty/eleventy"; | ||
|
||
export default function (eleventyConfig) { | ||
eleventyConfig.addPlugin(WebcPlugin, { | ||
components: "./test/render-plugin/webc/*.webc" | ||
}); | ||
|
||
eleventyConfig.addPlugin(RenderPlugin); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { RenderPlugin } from "@11ty/eleventy"; | ||
import WebcPlugin from "../../eleventyWebcPlugin.js"; | ||
|
||
export default function (eleventyConfig) { | ||
eleventyConfig.addPlugin(RenderPlugin); | ||
eleventyConfig.addPlugin(WebcPlugin, { | ||
components: "test/script-and-style-buckets/_components/**/*.webc" | ||
}); | ||
// eleventyConfig.addPlugin(eleventyConfig => { | ||
// console.log( eleventyConfig.javascriptFunctions ); | ||
// }) | ||
|
||
return { | ||
dir: { | ||
includes: "_includes", | ||
layouts: "_layouts", | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.