mikel-press 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +14 -0
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -23,6 +23,10 @@ const press = (config = {}) => {
|
|
|
23
23
|
nodes: [],
|
|
24
24
|
});
|
|
25
25
|
const getPlugins = name => context.plugins.filter(plugin => typeof plugin[name] === "function");
|
|
26
|
+
// 0. initialize
|
|
27
|
+
getPlugins("init").forEach(plugin => {
|
|
28
|
+
return plugin.init(context);
|
|
29
|
+
});
|
|
26
30
|
// 1. load nodes into context
|
|
27
31
|
const nodesPaths = new Set(); // prevent adding duplicated nodes
|
|
28
32
|
getPlugins("load").forEach(plugin => {
|
|
@@ -229,6 +233,16 @@ press.ContentPagePlugin = (siteData = {}) => {
|
|
|
229
233
|
};
|
|
230
234
|
};
|
|
231
235
|
|
|
236
|
+
// @description plugin to register mikel helpers and functions
|
|
237
|
+
press.UsePlugin = mikelPlugin => {
|
|
238
|
+
return {
|
|
239
|
+
name: "UsePlugin",
|
|
240
|
+
init: context => {
|
|
241
|
+
context.template.use(mikelPlugin);
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
|
|
232
246
|
// @description copy plugin
|
|
233
247
|
press.CopyAssetsPlugin = (options = {}) => {
|
|
234
248
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mikel-press",
|
|
3
3
|
"description": "A tiny and fast static site generator based on mikel templating",
|
|
4
|
-
"version": "0.22.
|
|
4
|
+
"version": "0.22.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"node": ">=20"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"mikel": "^0.22.
|
|
22
|
+
"mikel": "^0.22.2"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"README.md",
|