From dc62d332a20139cd3bf5ee36726f025d48a2bfa2 Mon Sep 17 00:00:00 2001 From: Anatoliy Serputov Date: Thu, 14 Oct 2021 01:12:30 -0400 Subject: [PATCH] * Final Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All Commits - First check - Cleared the code - SetTimeOut Bug fixed - Split file.js into index.js and create.js - Huge Split and Update For Files: index.js create.js main.js - More Split and Update For Files: index.js create.js main.js config.js… --- main.js | 29 +++++++++++------------------ src/page2.txt | 13 ------------- src/{index.txt => same.md} | 0 src/same.txt | 9 +++++++++ 4 files changed, 20 insertions(+), 31 deletions(-) delete mode 100644 src/page2.txt rename src/{index.txt => same.md} (100%) create mode 100644 src/same.txt diff --git a/main.js b/main.js index 4f55280..376571b 100644 --- a/main.js +++ b/main.js @@ -9,12 +9,6 @@ import { Config } from "./config.js"; export function Main(file) { let arr = []; // I can't see the way how to get rid of it because I push into that array all the files path's to build one index.js - let filename = file.input; - let style = file.stylesheet; - - if (filename.includes(".json")) { - Config(); - } const readFile = (filename) => { const rawFile = fs.readFileSync(filename, "utf8"); @@ -54,7 +48,7 @@ export function Main(file) { const outfilename = getOutputFilename(filename, outPath); arr.push(` ${outfilename}`); const templatized = templatize(template, { - link: `${style}`, + link: `${file.stylesheet}`, title: file.data.title, content: file.html, }); @@ -93,20 +87,19 @@ export function Main(file) { "utf8" ); - if (filename.includes(".")) { - if (filename.includes("txt")) { - const filenames = glob.sync(srcPath + `/**/${filename}`); - filenames.forEach((filename) => { + if (file.input.includes(".")) { + const filenames = glob.sync(srcPath + `/**/${file.input}`); + filenames.forEach((filename) => { + if (filename.includes("txt")) { processFile(filename, template, outPath); - }); - } else { - const filenames = glob.sync(srcPath + `/**/${filename}`); - filenames.forEach((filename) => { + } else if (filename.includes("md")) { processFile_md(filename, template, outPath); - }); - } + } else if (filename.includes(".json")) { + Config(); + } + }); } else { - const filenames = glob.sync(srcPath + `/${filename}/**/*.txt`); + const filenames = glob.sync(srcPath + `/${file.input}/**/*.txt`); filenames.forEach((filename) => { if (filename.includes(".txt")) { processFile(filename, template, outPath); diff --git a/src/page2.txt b/src/page2.txt deleted file mode 100644 index 72fdc2f..0000000 --- a/src/page2.txt +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Page 2 -author: JavaScript Joel -date: Aug 15, 2020 ---- - -# Almus Acrisium te in si fama est - -## Dote gravi iras innumerae fuge aut quid - -Lorem markdownum festas opposuitque illo cognovi perspice lacrimis vestigia; ut. -Ense e necat veteres usus non, ne tui _et esse_ arva Ismenis. In oracla montes -quidem, sublimis grata oculorum. Perque sorores. diff --git a/src/index.txt b/src/same.md similarity index 100% rename from src/index.txt rename to src/same.md diff --git a/src/same.txt b/src/same.txt new file mode 100644 index 0000000..ac5f0b6 --- /dev/null +++ b/src/same.txt @@ -0,0 +1,9 @@ +--- +title: Welcome to My Static Site +author: JavaScript Joel +date: Aug 15, 2020 +--- + +👋 Welcome fellow Tailwind CSS and miminal monochrome blog fan. This starter template provides a starting point to create your own minimal monochrome blog using Tailwind CSS and vanilla Javascript. + +The basic blog page layout is available and all using the default Tailwind CSS classes (although there are a few hardcoded style tags). If you are going to use this in your project, you will want to convert the classes into components.