First commit
Some checks failed
Blowfish Docs Deploy / build (push) Has been cancelled
Blowfish Docs Deploy / deploy (push) Has been cancelled
Test Build / Build Example Site (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Update Hugo version / updateBlowfish (push) Has been cancelled

Delete exampleSite
Add initial content, images & docker-compose.yml
Use extend-head.html for analytics
Set remote url to gitea.novicelab.io
Remove original .git due to "shallow update not allowed" error
This commit is contained in:
2026-03-14 14:37:54 +00:00
commit 6330092560
508 changed files with 36938 additions and 0 deletions

71
genLangLinks.js Normal file
View File

@@ -0,0 +1,71 @@
const fs = require("fs/promises");
const configDir = "./exampleSite/config/_default";
const contentDir = "./exampleSite/content";
const defaultLang = "en";
const targetLangs = [];
async function readConfigs() {
const files = await fs.readdir(configDir);
for (const file of files) {
console.log(file);
if (file.indexOf("languages.") > -1) {
const lang = file.split(".")[1];
console.log(lang);
if (lang != defaultLang) {
targetLangs.push(lang);
}
}
}
}
async function processFile(filePath, file) {
if (filePath.indexOf("index.md") > -1) {
console.log("processing", filePath);
for (const targetLang of targetLangs) {
const targetFilePath = filePath.replace(".md", "." + targetLang + ".md");
let exists = true;
try {
await fs.access(targetFilePath);
} catch {
exists = false;
}
if (exists) {
console.log("file already exists", targetFilePath);
} else {
console.log("creating file", targetFilePath);
await fs.copyFile(filePath, targetFilePath);
}
}
} else {
return;
}
}
async function processFolder(folderPath) {
const files = await fs.readdir(folderPath);
for (const file of files) {
const filePath = `${folderPath}/${file}`;
const isDir = (await fs.lstat(filePath)).isDirectory();
if (isDir) {
await processFolder(filePath);
} else {
await processFile(filePath, file);
}
}
}
async function createLinks() {
await processFolder(contentDir);
}
(async () => {
await readConfigs();
await createLinks();
})();