blog-engine-sac
Advanced tools
Comparing version 5.6.0 to 5.7.0
{ | ||
"name": "blog-engine-sac", | ||
"version": "5.6.0", | ||
"version": "5.7.0", | ||
"description": "static site generator, that uses markdown files as input and outputs web pages", | ||
@@ -5,0 +5,0 @@ "license": "CC0-1.0", |
@@ -65,6 +65,6 @@ export { processPost, processExternalPost, supportedFormats, getDetailsFromPost }; | ||
const { src } = post; | ||
let contentType; | ||
let contentType = post['Content-Type']; | ||
return fetch(src).then(response => { | ||
if (response.ok) { | ||
contentType = response.headers.get(`Content-Type`); | ||
contentType = contentType || response.headers.get(`Content-Type`); | ||
return response.text(); | ||
@@ -161,4 +161,4 @@ } | ||
const extension = extname(fullPath).substr(1); | ||
if (!supportedFormats.includes(extension) && extension !== ``) { | ||
console.warn(`File format from ${fullPath} is ${extension} and not recognized. | ||
if (!supportedFormats.includes(extension)) { | ||
console.warn(`File format from ${fullPath} is ${extension} extension and not recognized. | ||
Use one of ${supportedFormats.join(`, `)} instead.`); | ||
@@ -165,0 +165,0 @@ } |
@@ -6,4 +6,10 @@ /* stats.birthtime, can be later than modified date | ||
export { buildSite }; | ||
import { textFileContent, writeTextInFile, namesInDirectory } from "filesac"; | ||
import slugify from "@sindresorhus/slugify"; | ||
import url from "url"; | ||
import { load } from '@grossacasacs/left-phalange'; | ||
import markdownModule from "markdown"; | ||
const { markdown } = markdownModule; | ||
import { generateTags, wordCount, setFinalTags } from "./tags.js"; | ||
@@ -17,9 +23,4 @@ import { niceDateString, normalizeDate } from "./dates.js"; | ||
import { dirname, parse as parsePath } from "path"; | ||
import url from "url"; | ||
import { load } from '@grossacasacs/left-phalange'; | ||
import {indexFileName} from "../html/links.js"; | ||
import markdownModule from "markdown"; | ||
const { markdown } = markdownModule; | ||
@@ -38,3 +39,2 @@ import { createPostHtml } from "../html/post.html.js"; | ||
const defaultOptionsSource = `${__dirname}/../defaultSettings/default-blog-engine-sac`; | ||
const userOptionsSource = `./blog-engine-sac`; | ||
@@ -45,2 +45,3 @@ const postsPath = `./source/`; | ||
const footerSource = `${postsPath}/extras/footer.md`; | ||
// output | ||
@@ -178,6 +179,6 @@ const builtBlog = `./result`; | ||
const sourceFileNames2 = sourceFileNames.map((file) => { | ||
const sourceFilesPath = sourceFileNames.map((file) => { | ||
return `${postsPath}${file}`; | ||
}); | ||
const detailedSources = sourceFileNames2.map(getDetailsFromPost); | ||
const detailedSources = sourceFilesPath.map(getDetailsFromPost); | ||
@@ -184,0 +185,0 @@ /* pass this array so that processPost can use meta information of previous posts*/ |
@@ -6,2 +6,3 @@ export { processMetaFile }; | ||
const processMetaFile = async (detailedSource) => { | ||
// hanldes files without src (src is another file with same base name) | ||
const { title, extension, postFilePath, fullPath, base } = detailedSource; | ||
@@ -8,0 +9,0 @@ if (!supportedFormats.includes(extension)) { |
@@ -6,3 +6,3 @@ export { processPostAsMD, formatMD }; | ||
const formatMD = [`md`]; | ||
const formatMD = [`md`, `markdown`]; | ||
const processPostAsMD = function (post) { | ||
@@ -9,0 +9,0 @@ const { content } = post; |
@@ -17,3 +17,3 @@ export { processPostAsMulti, formatMulti }; | ||
} | ||
const { src } = postObject; | ||
const { src, ...rest } = postObject; | ||
if (!src) { | ||
@@ -24,5 +24,5 @@ return; | ||
// open from file | ||
return processPost(getDetailsFromPost(src), detailedFiles, metas, commonOptions); | ||
return processPost({...rest, ...getDetailsFromPost(src)}, detailedFiles, metas, commonOptions); | ||
} | ||
return processExternalPost({ ...post, src }); | ||
return processExternalPost({ ...post, ...postObject }); | ||
}; |
470795
11877