@daz4126/swifty 1.11.0 → 1.12.0

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/package.json +1 -1
  2. package/swifty.js +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daz4126/swifty",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {
package/swifty.js CHANGED
@@ -232,9 +232,8 @@ const generatePages = async (sourceDir, baseDir = sourceDir, parent) => {
232
232
  const name = root ? "Home" : capitalize(file.name.replace(/\.md$/, "").replace(/-/g, " "));
233
233
  const stats = await fs.stat(filePath);
234
234
  const isDirectory = file.isDirectory();
235
- const assetPath = parent ? parent.filename : "pages";
236
- const layoutFileExists = await fsExtra.pathExists(dirs.layouts + "/" + assetPath + ".html");
237
- const layout = !root && layoutFileExists && assetPath;
235
+ const layoutFileExists = parent && await fsExtra.pathExists(dirs.layouts + "/" + parent.filename + ".html");
236
+ const layout = layoutFileExists ? parent.filename : parent ? parent.layout : "pages";
238
237
 
239
238
  const page = {
240
239
  name, root, layout,