@moonwave99/goffre 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/lib/goffre.js +7 -3
  2. package/package.json +1 -1
package/lib/goffre.js CHANGED
@@ -63,9 +63,7 @@ export function getTemplate({
63
63
  templates = [],
64
64
  defaultTemplate = "_default",
65
65
  }) {
66
- if (
67
- templates.find((x) => path.basename(x, ".handlebars") === page.template)
68
- ) {
66
+ if (templates.find((x) => x === `${page.template}.handlebars`)) {
69
67
  return page.template;
70
68
  }
71
69
  if (templates.find((x) => x.startsWith(page.slug))) {
@@ -233,6 +231,12 @@ export async function render({
233
231
  env: { ...getEnv(), ...env },
234
232
  };
235
233
 
234
+ if (markdown.middleware) {
235
+ markdown.middleware.forEach((x) =>
236
+ marked.use(typeof x === "function" ? x() : x),
237
+ );
238
+ }
239
+
236
240
  marked.use(markdown);
237
241
 
238
242
  switch (logLevel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonwave99/goffre",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Mini static site generator",
5
5
  "author": {
6
6
  "name": "Diego Caponera",