Skip to content

Commit

Permalink
* Final Update
Browse files Browse the repository at this point in the history
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…
  • Loading branch information
Anatoliy Serputov committed Oct 14, 2021
1 parent eccd170 commit dc62d33
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
29 changes: 11 additions & 18 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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);
Expand Down
13 changes: 0 additions & 13 deletions src/page2.txt

This file was deleted.

File renamed without changes.
9 changes: 9 additions & 0 deletions src/same.txt
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit dc62d33

Please sign in to comment.