Merge pull request #823 from nunocoracao/744-revamp-user-list

🎨 Revamp user list
This commit is contained in:
Nuno Coração 2023-07-14 12:04:58 +01:00 committed by GitHub
commit 13a7ad8ec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1660 additions and 49 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View file

@ -0,0 +1,13 @@
---
title: "nunocoracao.com"
slug: "users"
tags: []
externalUrl: "https://nunocoracao.com"
showDate: false
showAuthor: false
showReadingTime: false
showEdit: false
showLikes: false
showViews: false
layoutBackgroundHeaderSpace: false
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -0,0 +1,13 @@
---
title: "madoke.org"
slug: "users"
tags: []
externalUrl: "https://madoke.org/"
showDate: false
showAuthor: false
showReadingTime: false
showEdit: false
showLikes: false
showViews: false
layoutBackgroundHeaderSpace: false
---

View file

@ -0,0 +1,27 @@
---
title: "Users"
date: 2020-08-14
draft: false
description: "Some real-life Blowfish examples."
slug: "users"
tags: ["users", "sample"]
showDate: false
showAuthor: false
showReadingTime: false
showEdit: false
layoutBackgroundHeaderSpace: false
---
{{< lead >}}
Real websites that are built with Blowfish.
{{< /lead >}}
{{< alert >}}
**Blowfish user?** To add your site to this list, [submit a pull request](https://github.com/nunocoracao/blowfish/blob/main/exampleSite/content/users/users.json).
{{</ alert >}}
</BR>

View file

@ -1,29 +1,3 @@
---
title: "Users"
date: 2020-08-14
draft: false
description: "Some real-life Blowfish examples."
slug: "users"
tags: ["users", "sample"]
showDate: false
showAuthor: false
showReadingTime: false
showEdit: false
layoutBackgroundHeaderSpace: false
---
{{< lead >}}
Real websites that are built with Blowfish.
{{< /lead >}}
{{< alert >}}
**Blowfish user?** To add your site to this list, [submit a pull request](https://github.com/nunocoracao/blowfish/blob/main/exampleSite/content/users/index.md).
{{</ alert >}}
| Website | Details |
| --------------------------------------------------------------------- | ---------------------------- |
| [nunocoracao.com](https://nunocoracao.com) | Personal site - Theme author |
@ -82,10 +56,4 @@ Real websites that are built with Blowfish.
| [50-nuances-octets.fr](https://www.50-nuances-octets.fr/) | Organization site |
| [marupanda.art/marucomics](https://marupanda.art/marucomics/) | Comics site |
| [seanomahoney.com](https://seanomahoney.com/) | Personal site |
| [pacochan.net](https://pacochan.net) | Personal site |
{{< alert >}}
**Blowfish user?** To add your site to this list, [submit a pull request](https://github.com/nunocoracao/blowfish/blob/main/exampleSite/content/users/index.md).
{{</ alert >}}
| [pacochan.net](https://pacochan.net) | Personal site |

View file

@ -0,0 +1,17 @@
[
{
"title": "nunocoracao.com",
"url": "https://nunocoracao.com",
"tags": [
"Personal site",
"Theme author"
]
},
{
"title": "madoke.org",
"url": "https://madoke.org/",
"tags": [
"Personal site"
]
}
]

BIN
nyt-puppeteer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

1520
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -43,6 +43,7 @@
"prettier": "^2.8.8",
"prettier-plugin-go-template": "^0.0.13",
"prettier-plugin-tailwindcss": "^0.4.0",
"puppeteer": "^20.8.2",
"rimraf": "^5.0.1",
"tailwindcss": "^3.3.3",
"tw-elements": "1.0.0-beta2",

84
processUsers.js Normal file
View file

@ -0,0 +1,84 @@
const fs = require('fs');
const puppeteer = require("puppeteer");
const usersFolderPath = "./exampleSite/content/users/"
let rawdata = fs.readFileSync(usersFolderPath + 'users.json');
let users = JSON.parse(rawdata);
const files = fs.readdirSync(usersFolderPath);
console.log(files);
for (file in files) {
let stats = fs.statSync(usersFolderPath + files[file]);
if (files[file] != 'users.json' && files[file] != '_index.md' && files[file] != 'tempusers.txt' && files[file] != 'oldindex.md') {
console.log('deleting: ', files[file]);
if (stats.isDirectory()) {
fs.rmdirSync(usersFolderPath + files[file], { recursive: true, force: true });
} else {
fs.unlinkSync(usersFolderPath + files[file]);
}
}
}
puppeteer
.launch({
defaultViewport: {
width: 1280,
height: 800,
},
})
.then(async (browser) => {
const page = await browser.newPage();
for (var i in users) {
console.log(i, users[i].title);
var userMDFile = "---\n\
title: \""+ users[i].title + "\"\n\
slug: \"users\"\n\
tags: []\n\
externalUrl: \""+ users[i].url + "\"\n\
showDate: false\n\
showAuthor: false\n\
showReadingTime: false\n\
showEdit: false\n\
showLikes: false\n\
showViews: false\n\
layoutBackgroundHeaderSpace: false\n\
\r---\n";
var dir = usersFolderPath + i + users[i].title;
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
fs.writeFileSync(dir + '/index.md', userMDFile);
await page.goto(users[i].url);
await page.screenshot({ path: dir + "/feature.png" });
}
await browser.close();
});
/*
puppeteer
.launch({
defaultViewport: {
width: 1280,
height: 800,
},
})
.then(async (browser) => {
const page = await browser.newPage();
await page.goto("https://nytimes.com");
await page.screenshot({ path: "nyt-puppeteer.png" });
await browser.close();
});*/