blog-engine-sac
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -28,3 +28,3 @@ export { createHeaderHtml }; | ||
<li class="nav-item" id="searchBlock" hidden> | ||
<input id="searchInput" placeholder="Search"> | ||
<input id="searchInput" placeholder="${translate(lang, `Search`)}"> | ||
<ol id="searchResults"></ol> | ||
@@ -31,0 +31,0 @@ </li> |
{ | ||
"name": "blog-engine-sac", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"type": "module", | ||
"bin": { | ||
"blog-engine-sac": "source/main.js" | ||
"blog-engine-sac": "node source/main.js" | ||
}, | ||
@@ -42,2 +42,3 @@ "scripts": { | ||
"files": [ | ||
"defaultSettings", | ||
"html", | ||
@@ -44,0 +45,0 @@ "js", |
@@ -14,3 +14,4 @@ /* stats.birthtime, can be later than modified date | ||
import {chainPromises} from "utilsac"; | ||
import { extname, basename, parse as parsePath } from "path"; | ||
import { dirname, parse as parsePath } from "path"; | ||
import url from "url"; | ||
@@ -23,3 +24,3 @@ import {indexFileName} from "../html/links.js"; | ||
import { createPostHtml } from "../html/post.html.js"; | ||
import {createIndexHtml } from "../html/index.html.js"; | ||
import { createIndexHtml } from "../html/index.html.js"; | ||
import { createContactHtml } from "../html/contact.html.js"; | ||
@@ -29,4 +30,9 @@ import { createAboutHtml } from "../html/about.html.js"; | ||
const __filename = url.fileURLToPath(import.meta.url); | ||
const __dirname = dirname(__filename); | ||
// sources | ||
const settingsSource = `./blog-engine-sac.json` | ||
const defaultOptionsSource = `${__dirname}/../defaultSettings/default-blog-engine-sac.json`; | ||
const userOptionsSource = `./blog-engine-sac.json` | ||
const postsPath = `./source/`; | ||
@@ -37,3 +43,2 @@ const aboutSource = `${postsPath}/extras/about.md`; | ||
const categoriesSource = `${postsPath}/extras/categories.json`; | ||
// output | ||
@@ -160,17 +165,16 @@ const builtBlog = `./result`; | ||
const categoriesPromise = getCategoriesList(); | ||
const commonOptions = { | ||
footerText: undefined, | ||
defaultLang: undefined, | ||
defaultAuthor: undefined, | ||
mainTitle: `Blog`, | ||
subTitle: `Change title and subtitle in blog-engine-sac.json`, | ||
}; | ||
const [sourceFileNames, footerText, settingsText] = await Promise.all([ | ||
const [sourceFileNames, footerText, userOptionsText, defaultOptionsText] = await Promise.all([ | ||
namesInDirectory(postsPath), | ||
textFileContent(footerSource), | ||
textFileContent(settingsSource), | ||
textFileContent(userOptionsSource), | ||
textFileContent(defaultOptionsSource), | ||
]); | ||
const defaultOptions = JSON.parse(defaultOptionsText); | ||
const userOptions = JSON.parse(userOptionsText); | ||
const commonOptions = { | ||
...defaultOptions, | ||
...userOptions, | ||
}; | ||
const footerHTML = markdown.toHTML(footerText); | ||
commonOptions.footerText = footerHTML; | ||
Object.assign(commonOptions, JSON.parse(settingsText)); | ||
@@ -177,0 +181,0 @@ const sourceFileNames2 = sourceFileNames.map((file) => { |
@@ -0,0 +0,0 @@ export { processMetaFile }; |
@@ -32,2 +32,3 @@ export { | ||
flatTarget: `css`, | ||
fromEngineItself: true, | ||
}); | ||
@@ -50,3 +51,3 @@ }; | ||
...options, | ||
fromBlogEngineZ: true, | ||
fromEngineItself: false, | ||
}); | ||
@@ -57,3 +58,3 @@ }); | ||
const copyArrayFiles = (filesToCopy, options) => { | ||
const { builtBlog, flatTarget, fromBlogEngineZ } = options; | ||
const { builtBlog, flatTarget, fromEngineItself } = options; | ||
return Promise.all(filesToCopy.map(function (fileToCopy) { | ||
@@ -67,3 +68,3 @@ let targetPath; | ||
let sourcePath; | ||
if (fromBlogEngineZ) { | ||
if (!fromEngineItself) { | ||
sourcePath = `.${fileToCopy}`; | ||
@@ -70,0 +71,0 @@ } else { |
@@ -0,0 +0,0 @@ export { isLocalUrl }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35
227151
7658