diff --git a/.docs/css.njk b/.docs/css.njk
index 632c147..0ce986a 100644
--- a/.docs/css.njk
+++ b/.docs/css.njk
@@ -4,3 +4,4 @@ permalink: theme.css
{% include "css/patterns.css" %}
{% include "css/theme.css" %}
{% include "css/gallerybox.css" %}
+{% include "css/smallscreens.css" %}
diff --git a/.docs/css/gallerybox.css b/.docs/css/gallerybox.css
index f0a2f8a..7294bfb 100644
--- a/.docs/css/gallerybox.css
+++ b/.docs/css/gallerybox.css
@@ -10,6 +10,12 @@ be (slightly) less hacky once :target-within lands in browsers.
Exported to codepen: https://codepen.io/sbrl/details/YzZJYxg
*/
+
+@media (orientation: landscape) {
+ .gallerybox-gallery {
+ max-width: 95vw;
+ }
+}
.gallerybox {
diff --git a/.docs/css/smallscreens.css b/.docs/css/smallscreens.css
new file mode 100644
index 0000000..c02a71a
--- /dev/null
+++ b/.docs/css/smallscreens.css
@@ -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;
+ }
+}
diff --git a/.docs/css/theme.css b/.docs/css/theme.css
index 8acaa30..636724f 100644
--- a/.docs/css/theme.css
+++ b/.docs/css/theme.css
@@ -102,18 +102,19 @@ nav ul {
margin: 0; padding: 0;
display: flex;
justify-content: space-evenly;
+ align-items: center;
}
-nav a {
+nav > ul a {
background: var(--bg-transcluscent-slight);
display: inline-block;
- padding: 1.2em 2em;
+ padding: 1.45em 2em;
text-decoration: none;
font-weight: bold;
color: var(--text-main);
}
nav li[aria-current=page] a {
- margin: -0.25em;
- border: 0.25em solid var(--bg-alt);
+ color: var(--bg-bright);
+ background: var(--text-main);
}
nav a.image {
@@ -247,10 +248,11 @@ footer {
display: flex;
flex-direction: column;
align-items: center; justify-content: center;
+ text-align: center; /* If any text wraps in a , then this makes sure it's still centred */
background: content-box linear-gradient(var(--bg-transcluscent), var(--bg-transcluscent)),
var(--bg) center / cover;
- height: 80vh;
+ height: max(30em, 80vh);
padding: 0 5em 0 5em;
box-sizing: border-box;
}
@@ -271,7 +273,7 @@ footer {
.features-large > :where(figure, .features-item) {
background: var(--bg-transcluscent);
background-image: var(--pattern-bricks);
- margin: 0.1em;
+ margin: 1em 0.1em;
padding: 1em;
max-width: 15em;
box-shadow: 0.25em 0.25em 0.5em var(--shadow);
@@ -279,7 +281,7 @@ footer {
.features-item.wide {
flex: 1;
max-width: initial;
- margin: 0.1em 2em;
+ margin: 0.5em 2em;
display: flex;
flex-direction: column;
justify-content: flex-start;
@@ -306,12 +308,13 @@ footer {
padding: 1em 0;
display: flex;
justify-content: space-around;
+ flex-wrap: wrap;
}
.bigbutton {
display: inline-block;
- margin: 0;
+ margin: 0.25em 0;
padding: 0.35em 0.45em;
border: 0;
border-radius: 0.25em;
diff --git a/.docs/package.json b/.docs/package.json
index 61199d1..a67a1ec 100644
--- a/.docs/package.json
+++ b/.docs/package.json
@@ -6,7 +6,8 @@
"private": true,
"scripts": {
"test": "echo \"No tests have been implemented yet\"",
- "start": "npx @11ty/eleventy --serve"
+ "start": "npx @11ty/eleventy --serve",
+ "build": "npx @11ty/eleventy"
},
"repository": {
"type": "git",
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..ea083f7
--- /dev/null
+++ b/build.sh
@@ -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!";