mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-10 22:09:31 +00:00
udpated users
This commit is contained in:
1 parent
d9ea382e81
commit
071ab0de6c
2220 files changed
+13727
-13332
No files matched your search
+6
-4
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user