@slybridges/kiss 0.8.1 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slybridges/kiss",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Keep It Simple and Static site generator",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -47,7 +47,7 @@ const computeIsPost = ({ content, isPost }) => isPost || !!content
47
47
 
48
48
  computeIsPost.kissDependencies = ["content", "isPost"]
49
49
 
50
- const computeOutputPath = ({ permalink }, config) => {
50
+ const computeOutputPath = ({ permalink, _meta }, config) => {
51
51
  if (!permalink) {
52
52
  return null
53
53
  }
@@ -56,13 +56,14 @@ const computeOutputPath = ({ permalink }, config) => {
56
56
  if (outputPath.endsWith("/")) {
57
57
  return path.join(outputPath, "index.html")
58
58
  }
59
- if (path.extname(outputPath) === "") {
59
+ // don't rely on path.extname because permalink can include dots
60
+ if (_meta.outputType === "HTML" && !outputPath.endsWith(".html")) {
60
61
  return outputPath + ".html"
61
62
  }
62
63
  return outputPath
63
64
  }
64
65
 
65
- computeOutputPath.kissDependencies = ["permalink"]
66
+ computeOutputPath.kissDependencies = ["permalink", "_meta.outputType"]
66
67
 
67
68
  module.exports = {
68
69
  computeAscendants: computeAscendants,