website: update 11ty to v3

This commit is contained in:
Starbeamrainbowlabs 2024-10-02 00:21:05 +01:00
parent f56b4ff8f6
commit 1f8ad8e106
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2
4 changed files with 1543 additions and 1850 deletions

@ -11,6 +11,7 @@
<link rel="icon" href="{% image_urlpass '../worldeditadditions.png' %}" type="image/png" sizes="540x540" />
<meta name="theme-color" content="#61b4f4" />
<meta name="generator" content="{{ eleventy.generator }}" />
<!-- OpenGraph -->
<meta property="og:title" content="WorldEditAdditions" />

@ -1,21 +1,25 @@
"use strict";
const os = require("os");
const fs = require("fs");
const path = require("path");
import os from "os";
import fs from "fs";
import path from "path";
const debug = require("debug");
const htmlentities = require("html-entities");
const phin = require("phin");
const CleanCSS = require("clean-css");
const { minify: minify_html } = require("html-minifier-terser");
import debug from "debug";
import htmlentities from "html-entities";
import phin from "phin";
import CleanCSS from "clean-css";
import { minify as minify_html } from "html-minifier-terser";
const moondoc_runner = require("./lib/moondoc_runner.js");
const HTMLPicture = require("./lib/HTMLPicture.js");
const FileFetcher = require("./lib/FileFetcher.js");
import UpgradeHelper from "@11ty/eleventy-upgrade-help";
import moondoc_runner from "./lib/moondoc_runner.js";
import HTMLPicture from "./lib/HTMLPicture.js";
import FileFetcher from "./lib/FileFetcher.js";
const file_fetcher = new FileFetcher();
// HACK: Make sure __dirname is defined when using es6 modules. I forget where I found this - a PR with a source URL would be great!
const __dirname = import.meta.url.slice(7, import.meta.url.lastIndexOf("/"));
const is_production = typeof process.env.NODE_ENV === "string" && process.env.NODE_ENV === "production";
var nextid = 0;
@ -120,11 +124,12 @@ async function do_minify_html(source, output_path) {
if(is_production) console.log("Production environment detected, minifying content");
module.exports = function(eleventyConfig) {
export default function config(eleventyConfig) {
moondoc_runner(
path.resolve(__dirname, "_site/api/index.html")
);
eleventyConfig.addPlugin(UpgradeHelper);
eleventyConfig.addTransform("cssmin", do_minify_css);
eleventyConfig.addTransform("htmlmin", do_minify_html);
@ -146,4 +151,4 @@ module.exports = function(eleventyConfig) {
"node_modules/keen-slider/keen-slider.es.js": "./keen-slider.es.js"
});
}
}

3356
.docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -20,8 +20,9 @@
},
"homepage": "https://github.com/sbrl/Minetest-WorldEditAdditions#readme",
"dependencies": {
"@11ty/eleventy": "^2.0.1",
"chroma-js": "^2.4.2",
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy-upgrade-help": "^3.0.1",
"chroma-js": "^3.1.1",
"clean-css": "^5.3.2",
"columnify": "^1.6.0",
"debug": "^4.3.7",