Merge pull request #823 from nunocoracao/744-revamp-user-list
🎨 Revamp user list
BIN
exampleSite/content/users/0nunocoracao.com/feature.png
Normal file
After Width: | Height: | Size: 1.1 MiB |
13
exampleSite/content/users/0nunocoracao.com/index.md
Normal 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
|
||||||
|
---
|
BIN
exampleSite/content/users/1madoke.org/feature.png
Normal file
After Width: | Height: | Size: 59 KiB |
13
exampleSite/content/users/1madoke.org/index.md
Normal 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
|
||||||
|
---
|
27
exampleSite/content/users/_index.md
Normal 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>
|
|
@ -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 |
|
| Website | Details |
|
||||||
| --------------------------------------------------------------------- | ---------------------------- |
|
| --------------------------------------------------------------------- | ---------------------------- |
|
||||||
| [nunocoracao.com](https://nunocoracao.com) | Personal site - Theme author |
|
| [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 |
|
| [50-nuances-octets.fr](https://www.50-nuances-octets.fr/) | Organization site |
|
||||||
| [marupanda.art/marucomics](https://marupanda.art/marucomics/) | Comics site |
|
| [marupanda.art/marucomics](https://marupanda.art/marucomics/) | Comics site |
|
||||||
| [seanomahoney.com](https://seanomahoney.com/) | Personal site |
|
| [seanomahoney.com](https://seanomahoney.com/) | Personal site |
|
||||||
| [pacochan.net](https://pacochan.net) | 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 >}}
|
|
17
exampleSite/content/users/users.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
After Width: | Height: | Size: 866 KiB |
After Width: | Height: | Size: 213 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 18 KiB |
BIN
nyt-puppeteer.png
Normal file
After Width: | Height: | Size: 285 KiB |
1520
package-lock.json
generated
|
@ -43,6 +43,7 @@
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"prettier-plugin-go-template": "^0.0.13",
|
"prettier-plugin-go-template": "^0.0.13",
|
||||||
"prettier-plugin-tailwindcss": "^0.4.0",
|
"prettier-plugin-tailwindcss": "^0.4.0",
|
||||||
|
"puppeteer": "^20.8.2",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
"tailwindcss": "^3.3.3",
|
"tailwindcss": "^3.3.3",
|
||||||
"tw-elements": "1.0.0-beta2",
|
"tw-elements": "1.0.0-beta2",
|
||||||
|
|
84
processUsers.js
Normal 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();
|
||||||
|
});*/
|