mirror of
https://github.com/Yet-Another-DreamTeam/extended-markdown.git
synced 2026-03-13 00:07:24 +00:00
inital setup
This commit is contained in:
parent
9f2f2b7bb7
commit
adbcfca181
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
input
|
||||
output
|
||||
node_modules
|
||||
1
components/header.emd
Normal file
1
components/header.emd
Normal file
@ -0,0 +1 @@
|
||||
# Header
|
||||
28
index.js
Normal file
28
index.js
Normal file
@ -0,0 +1,28 @@
|
||||
const { readdirSync, statSync, readFileSync } = require("fs");
|
||||
const { join } = require("path");
|
||||
|
||||
function getFilesFromFolder(staticpath) {
|
||||
let results = readdirSync(staticpath);
|
||||
let folders = [];
|
||||
let files = [];
|
||||
results.forEach((result) => {
|
||||
result = join(staticpath, result);
|
||||
if (statSync(result).isDirectory()) {
|
||||
folders.push(result);
|
||||
const folderfiles = getFilesFromFolder(result);
|
||||
folderfiles.forEach((folderfile) => files.push(folderfile));
|
||||
} else if (statSync(result).isFile()) {
|
||||
files.push(result);
|
||||
}
|
||||
});
|
||||
return files;
|
||||
}
|
||||
|
||||
let templatePaths = getFilesFromFolder(join(__dirname, "./templates"));
|
||||
let componentPaths = getFilesFromFolder(join(__dirname, "./components"));
|
||||
let templates = templatePaths.map((path) => {
|
||||
return { path: path, data: readFileSync(path, "utf-8") };
|
||||
});
|
||||
|
||||
console.log("Templates:", templates);
|
||||
// console.log("Templates:", components);
|
||||
3
templates/Login.emd
Normal file
3
templates/Login.emd
Normal file
@ -0,0 +1,3 @@
|
||||
<include>header</include>
|
||||
|
||||
# Login
|
||||
3
templates/Register.emd
Normal file
3
templates/Register.emd
Normal file
@ -0,0 +1,3 @@
|
||||
<include>header</include>
|
||||
|
||||
# Register
|
||||
3
templates/sub/Index.emd
Normal file
3
templates/sub/Index.emd
Normal file
@ -0,0 +1,3 @@
|
||||
<include>header</include>
|
||||
|
||||
# Index
|
||||
Loading…
x
Reference in New Issue
Block a user