Add contributors to website

This commit is contained in:
Starbeamrainbowlabs 2021-06-20 21:48:30 +01:00
parent a7abeadb9d
commit 142adc5beb
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 57 additions and 7 deletions

View file

@ -0,0 +1,23 @@
const fs = require("fs");
const path = require("path");
const htmlentities = require("htmlentities");
function read_contributors() {
return fs.readFileSync(path.resolve(__dirname, "../../CONTRIBUTORS.tsv"), "utf-8")
.split("\n")
.slice(1)
.filter(line => line.length > 0)
.map(line => line.split(/\s+/))
.map(items => { return {
handle: htmlentities.encode(items[0]),
name: htmlentities.encode(items[1]),
profile_url: `https://github.com/${encodeURIComponent(items[0])}`,
avatar_url: `https://avatars.githubusercontent.com/${encodeURIComponent(items[0])}`
} });
}
const contributors = read_contributors();
console.log(`CONTRIBUTORS`, contributors);
module.exports = contributors;

View file

@ -1,6 +1,3 @@
---
---
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -10,7 +7,7 @@
<link rel="stylesheet" href="/theme.css" /> <link rel="stylesheet" href="/theme.css" />
</head> </head>
<body> <body>
<nav> <nav class="shadow-bottom">
<h1> <h1>
<img src="https://starbeamrainbowlabs.com/images/placeholder/?width=64&height=64&text=%20?%20" alt="Placeholder logo" class="icon medium" /> <img src="https://starbeamrainbowlabs.com/images/placeholder/?width=64&height=64&text=%20?%20" alt="Placeholder logo" class="icon medium" />
WorldEditAdditions WorldEditAdditions
@ -28,9 +25,18 @@
{{ content | safe }} {{ content | safe }}
<footer class="shadow-top"> <footer class="shadow-top">
<p>Built with ❤️ by <a href="https://starbeamrainbowlabs.com/">Starbeamrainbowlabs</a></p> <p>WorldEditAdditions built with ❤️ by these awesome people:</p>
<p>Tech: <a href="https://www.11ty.dev/">Eleventy</a></p> <ul class="contributor-list">
<p>Licensed under <a href="https://www.mozilla.org/en-US/MPL/2.0/">Mozilla Public Licence 2.0</a> (<a href="https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)">tldr</a>)</p> {% for contributor in contributors %}
<li><a href="{{ contributor.profile_url }}">
<img class="icon large" src="{{ contributor.avatar_url }}" alt="{{ contributor.name }}" />
<span>{{ contributor.name }}</span>
</a></li>
{% endfor %}
</ul>
<p>Tech: <a href="https://www.11ty.dev/">Eleventy</a> (this website), <a href="https://github.com/shssoichiro/oxipng">Oxipng</a> (PNG image compression), <a href="https://www.minetest.net/">Minetest</a> (of course)</p>
<p>Licensed under the <a href="https://www.mozilla.org/en-US/MPL/2.0/">Mozilla Public Licence 2.0</a> (<a href="https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)">tldr</a>)</p>
</footer> </footer>
</body> </body>
</html> </html>

View file

@ -359,3 +359,21 @@ footer {
box-sizing: border-box; box-sizing: border-box;
margin: 0.5em; margin: 0.5em;
} }
.contributor-list {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.contributor-list li {
padding: 0.5em;
}
.contributor-list a {
display: flex;
flex-direction: column;
align-items: center;
}

3
CONTRIBUTORS.tsv Normal file
View file

@ -0,0 +1,3 @@
github_handle name
sbrl Starbeamrainbowlabs
VorTechnix VorTechnix
1 github_handle name
2 sbrl Starbeamrainbowlabs
3 VorTechnix VorTechnix