mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 09:03:01 +00:00
Merge branch 'main' into vortechnix
This commit is contained in:
commit
fc8f76b9dc
7 changed files with 241 additions and 11 deletions
|
@ -5,13 +5,33 @@
|
||||||
<title>{{ title }} • WorldEditAdditions</title>
|
<title>{{ title }} • WorldEditAdditions</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="/theme.css" />
|
<link rel="stylesheet" href="/theme.css" />
|
||||||
|
|
||||||
|
<link rel="icon" href="{% image_urlpass '../worldeditadditions-64.png' %}" type="image/png" sizes="64x64" />
|
||||||
|
<link rel="icon" href="{% image_urlpass '../worldeditadditions.png' %}" type="image/png" sizes="540x540" />
|
||||||
|
|
||||||
|
<meta name="theme-color" content="#61b4f4" />
|
||||||
|
|
||||||
|
<!-- OpenGraph -->
|
||||||
|
<meta property="og:title" content="WorldEditAdditions" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<!-- We wanted pepperminty.wiki, but it's too expensive :-( -->
|
||||||
|
<meta property="og:url" content="https://worldeditadditions.mooncarrot.space/" />
|
||||||
|
<meta property="og:image" content="https://worldeditadditions.mooncarrot.space{% image_url 'images/banner-main.jpeg' %}" />
|
||||||
|
<meta property="og:description" content="Extra tools and commands to extend WorldEdit for Minetest. If you can dream of it, it probably belongs here!" />
|
||||||
|
|
||||||
|
<!-- Twitter Cards -->
|
||||||
|
<meta property="twitter:card" content="summary" />
|
||||||
|
<meta property="twitter:site" content="@SBRLabs" />
|
||||||
|
<meta property="twitter:title" content="WorldEditAdditions" />
|
||||||
|
<meta property="twitter:description" content="Extra tools and commands to extend WorldEdit for Minetest. If you can dream of it, it probably belongs here!" />
|
||||||
|
<meta property="twitter:image" content="https://worldeditadditions.mooncarrot.space{% image_urlpass '../worldeditadditions.png' %}" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="shadow-bottom">
|
<nav class="shadow-bottom">
|
||||||
<h1>
|
<h1><a href="/" class="invisilink">
|
||||||
<img src="{% image_urlpass '../worldeditadditions.png' %}" alt="" class="icon logo" />
|
<img src="{% image_urlpass '../worldeditadditions.png' %}" alt="" class="icon logo" />
|
||||||
WorldEditAdditions
|
WorldEditAdditions
|
||||||
</h1>
|
</a></h1>
|
||||||
<ul>
|
<ul>
|
||||||
{% for navitem in collections.navigable %}
|
{% for navitem in collections.navigable %}
|
||||||
<li {% if page.url == navitem.url %}aria-current="page"{% endif %}>
|
<li {% if page.url == navitem.url %}aria-current="page"{% endif %}>
|
||||||
|
|
|
@ -4,3 +4,4 @@ permalink: theme.css
|
||||||
{% include "css/patterns.css" %}
|
{% include "css/patterns.css" %}
|
||||||
{% include "css/theme.css" %}
|
{% include "css/theme.css" %}
|
||||||
{% include "css/gallerybox.css" %}
|
{% include "css/gallerybox.css" %}
|
||||||
|
{% include "css/smallscreens.css" %}
|
||||||
|
|
|
@ -11,6 +11,12 @@ be (slightly) less hacky once :target-within lands in browsers.
|
||||||
Exported to codepen: https://codepen.io/sbrl/details/YzZJYxg
|
Exported to codepen: https://codepen.io/sbrl/details/YzZJYxg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@media (orientation: landscape) {
|
||||||
|
.gallerybox-gallery {
|
||||||
|
max-width: 95vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.gallerybox {
|
.gallerybox {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
34
.docs/css/smallscreens.css
Normal file
34
.docs/css/smallscreens.css
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
@media (max-width: 1200px) {
|
||||||
|
nav > ul a {
|
||||||
|
padding: 1.45em 0.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media (max-width: 930px) {
|
||||||
|
nav {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > h1 {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigbox {
|
||||||
|
padding: 0 5vmin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
nav > ul {
|
||||||
|
padding-top: 0.5em;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigbox h1 {
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
}
|
|
@ -102,18 +102,19 @@ nav ul {
|
||||||
margin: 0; padding: 0;
|
margin: 0; padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
nav a {
|
nav > ul a {
|
||||||
background: var(--bg-transcluscent-slight);
|
background: var(--bg-transcluscent-slight);
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 1.2em 2em;
|
padding: 1.45em 2em;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--text-main);
|
color: var(--text-main);
|
||||||
}
|
}
|
||||||
nav li[aria-current=page] a {
|
nav li[aria-current=page] a {
|
||||||
margin: -0.25em;
|
color: var(--bg-bright);
|
||||||
border: 0.25em solid var(--bg-alt);
|
background: var(--text-main);
|
||||||
}
|
}
|
||||||
|
|
||||||
nav a.image {
|
nav a.image {
|
||||||
|
@ -247,10 +248,11 @@ footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center; justify-content: center;
|
align-items: center; justify-content: center;
|
||||||
|
text-align: center; /* If any text wraps in a <p>, then this makes sure it's still centred */
|
||||||
background: content-box linear-gradient(var(--bg-transcluscent), var(--bg-transcluscent)),
|
background: content-box linear-gradient(var(--bg-transcluscent), var(--bg-transcluscent)),
|
||||||
var(--bg) center / cover;
|
var(--bg) center / cover;
|
||||||
|
|
||||||
height: 80vh;
|
height: max(30em, 80vh);
|
||||||
padding: 0 5em 0 5em;
|
padding: 0 5em 0 5em;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
@ -271,7 +273,7 @@ footer {
|
||||||
.features-large > :where(figure, .features-item) {
|
.features-large > :where(figure, .features-item) {
|
||||||
background: var(--bg-transcluscent);
|
background: var(--bg-transcluscent);
|
||||||
background-image: var(--pattern-bricks);
|
background-image: var(--pattern-bricks);
|
||||||
margin: 0.1em;
|
margin: 1em 0.1em;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
max-width: 15em;
|
max-width: 15em;
|
||||||
box-shadow: 0.25em 0.25em 0.5em var(--shadow);
|
box-shadow: 0.25em 0.25em 0.5em var(--shadow);
|
||||||
|
@ -279,7 +281,7 @@ footer {
|
||||||
.features-item.wide {
|
.features-item.wide {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: initial;
|
max-width: initial;
|
||||||
margin: 0.1em 2em;
|
margin: 0.5em 2em;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
@ -306,12 +308,13 @@ footer {
|
||||||
padding: 1em 0;
|
padding: 1em 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bigbutton {
|
.bigbutton {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
margin: 0;
|
margin: 0.25em 0;
|
||||||
padding: 0.35em 0.45em;
|
padding: 0.35em 0.45em;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 0.25em;
|
border-radius: 0.25em;
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"No tests have been implemented yet\"",
|
"test": "echo \"No tests have been implemented yet\"",
|
||||||
"start": "npx @11ty/eleventy --serve"
|
"start": "npx @11ty/eleventy --serve",
|
||||||
|
"build": "npx @11ty/eleventy"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
165
build.sh
Executable file
165
build.sh
Executable file
|
@ -0,0 +1,165 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e;
|
||||||
|
|
||||||
|
# ██████ ██ ██████ ██ ██ ██ ██ ██████
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██ ██ ██████ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██████ ██ ██████ ██████ ██ ███████ ██████
|
||||||
|
|
||||||
|
# This script's purpose is to execute CI build tasks for WorlEditAdditions.
|
||||||
|
#
|
||||||
|
# Currently this involves building the website & uploading it to the web
|
||||||
|
# server (though the upload obviously requires an SSH key).
|
||||||
|
#
|
||||||
|
# You do NOT need to run this script to use WorldEditAdditions - only to build
|
||||||
|
# the website.
|
||||||
|
|
||||||
|
# If you try and submit malware to this file, you WILL receive a PERMANENT BAN,
|
||||||
|
# and I WILL report you to all the places I possibly can.
|
||||||
|
|
||||||
|
deploy_ssh_user="ci";
|
||||||
|
deploy_ssh_host="starbeamrainbowlabs.com";
|
||||||
|
deploy_ssh_port="2403";
|
||||||
|
|
||||||
|
deploy_root_dir="WorldEditAdditions";
|
||||||
|
|
||||||
|
# Make sure $WORKSPACE is set to ensure compatilibity with a regular shell
|
||||||
|
# This is important until we get our CI server back up and running
|
||||||
|
WORKSPACE="${WORKSPACE:-$PWD}";
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
log_msg() {
|
||||||
|
echo "[ $SECONDS ] >>> $*" >&2;
|
||||||
|
}
|
||||||
|
|
||||||
|
# $1 - Command name to check for
|
||||||
|
check_command() {
|
||||||
|
set +e;
|
||||||
|
which $1 >/dev/null 2>&1; exit_code=$?
|
||||||
|
if [[ "${exit_code}" -ne 0 ]]; then
|
||||||
|
log_msg "Error: Couldn't locate $1. Make sure it's installed and in your path.";
|
||||||
|
fi
|
||||||
|
set -e;
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
log_msg "WorldEditAdditions build script starting";
|
||||||
|
log_msg "You do NOT need to run this script to use WorldEditAdditions - this script is for my Continuous Integration server to build and deploy the website :-)";
|
||||||
|
|
||||||
|
check_command node;
|
||||||
|
check_command npm;
|
||||||
|
check_command npx;
|
||||||
|
check_command cat;
|
||||||
|
check_command sftp;
|
||||||
|
check_command lftp;
|
||||||
|
|
||||||
|
if [[ -z "${SSH_KEY_PATH}" ]]; then
|
||||||
|
echo "Error: SSH_KEY_PATH environment variable is not set.";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
temp_dir="$(mktemp --tmpdir -d "WorldEditAdditions-XXXXXXX")";
|
||||||
|
on_exit() {
|
||||||
|
rm -rf "${temp_dir}";
|
||||||
|
}
|
||||||
|
trap on_exit EXIT;
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
cd "./.docs" || { echo "Failed to cd into ./.docs"; exit 1; };
|
||||||
|
|
||||||
|
# ██████ ██ ██ ██ ██ ██████
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██████ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██████ ██████ ██ ███████ ██████
|
||||||
|
|
||||||
|
log_msg "Installing website dependencies";
|
||||||
|
|
||||||
|
npm install;
|
||||||
|
|
||||||
|
log_msg "Building website";
|
||||||
|
|
||||||
|
npm run build;
|
||||||
|
|
||||||
|
if [[ ! -d "_site" ]]; then
|
||||||
|
log_msg "Error: No website build output generated (eh?)";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# █████ ██████ ██████ ██ ██ ██ ██ ██ ███████
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ███████ ██████ ██ ███████ ██ ██ ██ █████
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██ ██ ██ ██ ██████ ██ ██ ██ ████ ███████
|
||||||
|
|
||||||
|
if [[ ! -z "${ARCHIVE}" ]]; then
|
||||||
|
log_msg "Archiving content";
|
||||||
|
check_command tar;
|
||||||
|
check_command gzip;
|
||||||
|
|
||||||
|
cd "_site" || { echo "Failed to cd into _site"; exit 1; };
|
||||||
|
|
||||||
|
tar -caf "${ARCHIVE}/WorldEditAdditions-website.tar.gz" .;
|
||||||
|
|
||||||
|
log_msg "Archived to ${ARCHIVE}/WorldEditAdditions-website.tar.gz:";
|
||||||
|
ls -lh "${ARCHIVE}/WorldEditAdditions-website.tar.gz";
|
||||||
|
|
||||||
|
cd ".." || { echo "Failed to parent directory again"; exit 1; };
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# ██ ██ ██████ ██ ██████ █████ ██████
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██ ██ ██████ ██ ██ ██ ███████ ██ ██
|
||||||
|
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||||
|
# ██████ ██ ███████ ██████ ██ ██ ██████
|
||||||
|
|
||||||
|
log_msg "Acquiring upload lock";
|
||||||
|
# Acquire an exclusive project-wide lock so that we only upload stuff one-at-a-time
|
||||||
|
exec 9<"${WORKSPACE}";
|
||||||
|
flock --exclusive 9;
|
||||||
|
|
||||||
|
log_msg "Deploying to server";
|
||||||
|
|
||||||
|
# Actions:
|
||||||
|
# [sftp] 1. Connect to remote server
|
||||||
|
# [sftp] 2. Upload new files
|
||||||
|
# [lftp] 4. Swap in new directory
|
||||||
|
# [lftp] 5. Delete old directory
|
||||||
|
|
||||||
|
sftp -i "${SSH_KEY_PATH}" -P "${deploy_ssh_port}" -o PasswordAuthentication=no "${deploy_ssh_user}@${deploy_ssh_host}" << SFTPCOMMANDS
|
||||||
|
mkdir ${deploy_root_dir}/www-new
|
||||||
|
put -r _site/* ${deploy_root_dir}/www-new
|
||||||
|
bye
|
||||||
|
SFTPCOMMANDS
|
||||||
|
|
||||||
|
lftp_commands_filename="${temp_dir}/commands.lftp";
|
||||||
|
|
||||||
|
(
|
||||||
|
echo "set sftp:connect-program 'ssh -x -i ${SSH_KEY_PATH}'";
|
||||||
|
# We have an extra : before the @ here to avoid the password prompt
|
||||||
|
echo "connect sftp://${deploy_ssh_user}:@${deploy_ssh_host}:${deploy_ssh_port}";
|
||||||
|
|
||||||
|
echo "mv \"${deploy_root_dir}/www\" \"${deploy_root_dir}/www-old\"";
|
||||||
|
echo "mv \"${deploy_root_dir}/www-new\" \"${deploy_root_dir}/www\"";
|
||||||
|
echo "rm -r \"${deploy_root_dir}/www-old\"";
|
||||||
|
echo "bye";
|
||||||
|
) >"${lftp_commands_filename}";
|
||||||
|
|
||||||
|
|
||||||
|
lftp --version;
|
||||||
|
cat "${lftp_commands_filename}";
|
||||||
|
lftp -f "${lftp_commands_filename}";
|
||||||
|
exit_code=$?
|
||||||
|
|
||||||
|
log_msg "Releasing lock";
|
||||||
|
exec 9>&- # Close file descriptor 9 and release the lock
|
||||||
|
|
||||||
|
|
||||||
|
log_msg "Complete!";
|
Loading…
Reference in a new issue