update to user process script
Some checks failed
Test Build / Build Example Site (push) Has been cancelled
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 36 KiB |
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
title: "albertolvera.com"
|
||||
tags: [Sito personale]
|
||||
externalUrl: "https://albertolvera.com"
|
||||
weight: 81
|
||||
title: "さばっこ"
|
||||
tags: [Sito personale, Blog]
|
||||
externalUrl: "https://sabac.co"
|
||||
weight: 961
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
title: "albertolvera.com"
|
||||
tags: [個人サイト]
|
||||
externalUrl: "https://albertolvera.com"
|
||||
weight: 81
|
||||
title: "さばっこ"
|
||||
tags: [個人サイト, ブログ]
|
||||
externalUrl: "https://sabac.co"
|
||||
weight: 961
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
title: "albertolvera.com"
|
||||
tags: [Personal site]
|
||||
externalUrl: "https://albertolvera.com"
|
||||
weight: 81
|
||||
title: "さばっこ"
|
||||
tags: [Personal site,Blog]
|
||||
externalUrl: "https://sabac.co"
|
||||
weight: 961
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
title: "albertolvera.com"
|
||||
tags: [个人网站]
|
||||
externalUrl: "https://albertolvera.com"
|
||||
weight: 81
|
||||
title: "さばっこ"
|
||||
tags: [个人网站, 博客]
|
||||
externalUrl: "https://sabac.co"
|
||||
weight: 961
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 175 KiB |
After Width: | Height: | Size: 61 KiB |
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "Academy Customize"
|
||||
tags: [Sito aziendale]
|
||||
externalUrl: "https://acamize.com/"
|
||||
weight: 951
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
||||
showEdit: false
|
||||
showLikes: false
|
||||
showViews: false
|
||||
layoutBackgroundHeaderSpace: false
|
||||
---
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "Academy Customize"
|
||||
tags: [事業所]
|
||||
externalUrl: "https://acamize.com/"
|
||||
weight: 951
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
||||
showEdit: false
|
||||
showLikes: false
|
||||
showViews: false
|
||||
layoutBackgroundHeaderSpace: false
|
||||
---
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: "Academy Customize"
|
||||
tags: [Business site]
|
||||
externalUrl: "https://acamize.com/"
|
||||
weight: 951
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
||||
showEdit: false
|
||||
showLikes: false
|
||||
showViews: false
|
||||
layoutBackgroundHeaderSpace: false
|
||||
---
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "Academy Customize"
|
||||
tags: [企业网站]
|
||||
externalUrl: "https://acamize.com/"
|
||||
weight: 951
|
||||
showDate: false
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
||||
showEdit: false
|
||||
showLikes: false
|
||||
showViews: false
|
||||
layoutBackgroundHeaderSpace: false
|
||||
---
|
||||
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
@ -64,14 +64,6 @@
|
|||
"College club site"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "albertolvera.com",
|
||||
"url": "https://albertolvera.com",
|
||||
"source": "n/a",
|
||||
"tags": [
|
||||
"Personal site"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "fahru.my.id",
|
||||
"url": "https://www.fahru.my.id",
|
||||
|
|
|
@ -32,7 +32,7 @@ let rawdata = fs.readFileSync(usersFolderPath + 'users.json');
|
|||
let users = JSON.parse(rawdata);
|
||||
let userDict = {}
|
||||
for (var i in users) {
|
||||
userDict[users[i].title.replaceAll("/", "-")] = true;
|
||||
userDict[generateDirName(users[i].url)] = true;
|
||||
}
|
||||
|
||||
const files = fs.readdirSync(usersFolderPath);
|
||||
|
@ -42,7 +42,7 @@ for (file in files) {
|
|||
let stats = fs.statSync(usersFolderPath + files[file]);
|
||||
if (files[file] != 'users.json' && files[file].indexOf("_index.") == -1) {
|
||||
if (stats.isDirectory()) {
|
||||
if (!userDict[files[file].replaceAll("/", "-")]) {
|
||||
if (!userDict[files[file]]) {
|
||||
console.log('deleting: ', files[file]);
|
||||
fs.rmdirSync(usersFolderPath + files[file], { recursive: true, force: true });
|
||||
}
|
||||
|
@ -55,6 +55,13 @@ for (file in files) {
|
|||
|
||||
var cache = {};
|
||||
|
||||
function generateDirName(seed) {
|
||||
var hash = crypto.createHash('md5');
|
||||
hash.update(seed);
|
||||
var dir = hash.digest('hex');
|
||||
return dir;
|
||||
}
|
||||
|
||||
async function convert(text, from, to) {
|
||||
var options = {
|
||||
from: from,
|
||||
|
@ -112,7 +119,7 @@ puppeteer
|
|||
title: \""+ users[i].title + "\"\n\
|
||||
tags: ["+ users[i].tags + "]\n\
|
||||
externalUrl: \""+ users[i].url + "\"\n\
|
||||
weight: "+ (i+1) +"\n\
|
||||
weight: "+ (i + 1) + "\n\
|
||||
showDate: false\n\
|
||||
showAuthor: false\n\
|
||||
showReadingTime: false\n\
|
||||
|
@ -122,11 +129,7 @@ puppeteer
|
|||
layoutBackgroundHeaderSpace: false\n\
|
||||
\r---\n";
|
||||
|
||||
//digest the title to create a folder
|
||||
var hash = crypto.createHash('md5');
|
||||
hash.update(users[i].url);
|
||||
var dir = usersFolderPath + hash.digest('hex');
|
||||
|
||||
var dir = usersFolderPath + generateDirName(users[i].url);
|
||||
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir);
|
||||
|
|