udpated users

This commit is contained in:
Nuno Coração
2026-01-12 18:06:16 +00:00
parent d9ea382e81
commit 071ab0de6c
2220 changed files with 13727 additions and 13332 deletions

View File

@@ -9,10 +9,10 @@ const usersFolderPath = "./exampleSite/content/users/";
let cache = {};
function generateDirName(seed) {
function generateDirName(seed, index) {
const hash = crypto.createHash("md5");
hash.update(seed);
return hash.digest("hex");
return index + "-" + hash.digest("hex");
}
async function convert(text, from, to) {
@@ -72,8 +72,10 @@ async function translateFrontMatterTags(block, targetLang, tags) {
const rawdata = await fs.readFile(usersFolderPath + "users.json", "utf8");
const users = JSON.parse(rawdata);
const userDict = {};
var index = 0;
for (const user of users) {
userDict[generateDirName(user.url)] = true;
userDict[generateDirName(user.url, index)] = true;
index++;
}
const files = await fs.readdir(usersFolderPath);
@@ -117,7 +119,7 @@ async function translateFrontMatterTags(block, targetLang, tags) {
" layoutBackgroundHeaderSpace: false\n" +
" \r---\n";
const dir = usersFolderPath + generateDirName(user.url);
const dir = usersFolderPath + generateDirName(user.url, i);
try {
await fs.access(dir);