0
0

Updated npm modules

This commit is contained in:
Opnxng 2024-10-16 12:39:17 +08:00
parent 427e5b8b21
commit f6fbea2cdf
10 changed files with 2480 additions and 1572 deletions

View File

@ -1,82 +1,101 @@
const { DateTime } = require("luxon"); const { DateTime } = require("luxon");
const CleanCSS = require("clean-css"); //const CleanCSS = require("clean-css");
const htmlmin = require("html-minifier"); const { minify } = require("html-minifier-terser");
const markdownIt = require("markdown-it"); const markdownIt = require("markdown-it");
const markdownItAttrs = require("markdown-it-attrs"); const markdownItAttrs = require("markdown-it-attrs");
const markdownItAnchor = require("markdown-it-anchor"); const markdownItAnchor = require("markdown-it-anchor");
module.exports = function(eleventyConfig) { module.exports = function (eleventyConfig) {
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.setUseGitIgnore(false); const mdOptions = {
html: true,
breaks: true,
linkify: true,
};
const mdOptions = { const markdownItAnchorOptions = {
html: true, level: 2, // minimum level header -- anchors will only be applied to h2 level headers and below but not h1
breaks: true, permalink: true,
linkify: true, };
};
const markdownItAnchorOptions = { const markdownLib = markdownIt(mdOptions)
level: 2, // minimum level header -- anchors will only be applied to h2 level headers and below but not h1 .use(markdownItAnchor, markdownItAnchorOptions)
permalink: true, .use(markdownItAttrs)
.use(require("markdown-it-bracketed-spans"))
.disable("code");
eleventyConfig.setLibrary("md", markdownLib);
eleventyConfig.setTemplateFormats([
"md",
"webmanifest",
"xml",
"ico",
"avif",
"webp",
"webm",
"svg",
"png",
"jpg",
"jpeg",
"txt",
"woff",
"woff2",
"css",
"pdf",
]);
eleventyConfig.addFilter("readablePostDate", (dateObj) => {
return DateTime.fromJSDate(dateObj, {
zone: "Asia/Singapore",
})
.setLocale("en-GB")
.toLocaleString({ day: "numeric", month: "short", year: "numeric" });
});
eleventyConfig.addFilter("postDate", (dateObj) => {
return DateTime.fromJSDate(dateObj, {
zone: "Asia/Singapore",
})
.setLocale("en-GB")
.toISODate();
});
eleventyConfig.addTransform("minifyHTML", function (content, outputPath) {
// Only minify HTML files
if (outputPath && outputPath.endsWith(".html")) {
return minify(content, {
collapseWhitespace: true, // Collapses whitespace between tags
removeComments: true, // Removes HTML comments
minifyCSS: true, // Minifies inline CSS
minifyJS: true, // Minifies inline JavaScript
removeAttributeQuotes: true, // Removes quotes around attributes when possible
removeOptionalTags: true, // Removes optional HTML tags (<html>, <head>, <body>)
collapseBooleanAttributes: true, // Converts boolean attributes to HTML5 style
removeEmptyAttributes: true, // Removes empty attributes
minifyURLs: true, // Minifies URLs in attributes
html5: true, // Enables HTML5 parsing
// caseSensitive: true, // Treats tags and attributes as case-sensitive
// keepClosingSlash: true, // Keeps trailing slash on self-closing tags
// quoteCharacter: '"', // Specifies quote character for attributes
// processConditionalComments: true, // Processes conditional comments in IE
// trimCustomFragments: true, // Trims custom HTML fragments
});
} }
const markdownLib = markdownIt(mdOptions)
.use(markdownItAnchor,markdownItAnchorOptions)
.use(markdownItAttrs)
.use(require('markdown-it-bracketed-spans'))
.disable("code");
eleventyConfig.setLibrary("md", markdownLib);
eleventyConfig.setTemplateFormats([
"md",
"webmanifest",
"xml",
"ico",
"svg",
"png",
"jpg",
"txt",
"woff",
"woff2",
"css",
"pdf"
]);
eleventyConfig.addFilter("readablePostDate", (dateObj) => {
return DateTime.fromJSDate(dateObj, {
zone: "Asia/Singapore",
}).setLocale('en-GB').toLocaleString({day: 'numeric',month: 'short',year: 'numeric'});
});
eleventyConfig.addFilter("postDate", (dateObj) => {
return DateTime.fromJSDate(dateObj, {
zone: "Asia/Singapore",
}).setLocale('en-GB').toISODate();
});
eleventyConfig.addTransform("htmlmin", function(content, outputPath) {
if( outputPath && outputPath.endsWith(".html") ) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
return minified;
}
return content; return content;
}); });
return { return {
dir: { dir: {
input: "src", input: "src",
includes: "_includes", includes: "_includes",
output: "site" output: "site",
} },
} };
eleventyConfig.addPassthroughCopy('/src/css') eleventyConfig.addPassthroughCopy("/src/css");
return { return {
passthroughFileCopy: true passthroughFileCopy: true,
} };
}; };

View File

@ -20,7 +20,7 @@ docker run --rm --name=npm -u 1000 -v /path/to/website:/app -w /app node:lts-sli
npm \ npm \
@11ty/eleventy \ @11ty/eleventy \
luxon \ luxon \
html-minifier \ html-minifier-terser \
clean-css \ clean-css \
markdown-it-attrs \ markdown-it-attrs \
markdown-it-bracketed-spans \ markdown-it-bracketed-spans \

0
src/felix.md → back up/felix.md Executable file → Normal file
View File

BIN
back up/felix1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

BIN
back up/felix2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

3610
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
{ {
"dependencies": { "dependencies": {
"@11ty/eleventy": "^2.0.1", "@11ty/eleventy": "^3.0.0",
"clean-css": "^5.3.3", "clean-css": "^5.3.3",
"html-minifier": "^4.0.0", "html-minifier-terser": "^7.2.0",
"luxon": "^2.5.2", "luxon": "^2.5.2",
"markdown-it-anchor": "^8.6.7", "markdown-it-anchor": "^8.6.7",
"markdown-it-attrs": "^4.1.6", "markdown-it-attrs": "^4.1.6",
"markdown-it-bracketed-spans": "^1.0.1", "markdown-it-bracketed-spans": "^1.0.1",
"npm": "^10.8.1" "npm": "^10.9.0"
} }
} }

View File

@ -2,7 +2,6 @@
layout: layout.njk layout: layout.njk
title: Opnxng | Blog title: Opnxng | Blog
date: 2023-01-01 date: 2023-01-01
--- ---
[![Vanessa Rossetto - The Actress ](/img/theactress.jpg)](https://erstwhilerecords.bandcamp.com/album/the-actress){target="_blank"} [![Vanessa Rossetto - The Actress ](/img/theactress.jpg)](https://erstwhilerecords.bandcamp.com/album/the-actress){target="_blank"}

View File

@ -2,48 +2,79 @@
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
@font-face { @font-face {
font-family: "eb_garamond_initials"; font-family: "eb_garamond_initials";
src: url("/css/fonts/ebgaramond-initials-webfont.woff2") format("woff2"), src:
url("/css/fonts/ebgaramond-initials-webfont.woff") format("woff"); url("/css/fonts/ebgaramond-initials-webfont.woff2") format("woff2"),
url("/css/fonts/ebgaramond-initials-webfont.woff") format("woff");
unicode-range: U+0020-FB02; unicode-range: U+0020-FB02;
} }
@font-face { @font-face {
font-family: "HeldaneText-Regular"; font-family: "HeldaneText-Regular";
src: url("/css/fonts/HeldaneText-Regular.woff2") format("woff2"), src:
url("/css/fonts/HeldaneText-Regular.woff") format("woff"); url("/css/fonts/HeldaneText-Regular.woff2") format("woff2"),
url("/css/fonts/HeldaneText-Regular.woff") format("woff");
unicode-range: U+0020-FB02; unicode-range: U+0020-FB02;
} }
@font-face { @font-face {
font-family: "HeldaneText-RegularItalic"; font-family: "HeldaneText-RegularItalic";
src: url("/css/fonts/HeldaneText-RegularItalic.woff2") format("woff2"), src:
url("/css/fonts/HeldaneText-RegularItalic.woff") format("woff"); url("/css/fonts/HeldaneText-RegularItalic.woff2") format("woff2"),
url("/css/fonts/HeldaneText-RegularItalic.woff") format("woff");
unicode-range: U+0020-FB02; unicode-range: U+0020-FB02;
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
:root { :root {
--line-height: 1.35; --line-height: 1.35;
--text-color: #262626; --text-color: #262626;
--primary-background-color: #FFFFFF; --primary-background-color: #ffffff;
--secondary-background-color: #FAFAFA; --secondary-background-color: #fafafa;
--primary-color: #20599E; --primary-color: #20599e;
--secondary-color: #20599E; --secondary-color: #20599e;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--text-color: #D1D1CF; --text-color: #d1d1cf;
--primary-background-color: #0E0E0F; --primary-background-color: #0e0e0f;
--secondary-background-color: #0E0E0F; --secondary-background-color: #0e0e0f;
--primary-color: #1860A3; --primary-color: #1860a3;
--secondary-color: #1860A3; --secondary-color: #1860a3;
} }
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
@media (orientation: landscape) {:root {--font-size: 1.42rem;}} @media (orientation: landscape) {
@media (orientation: portrait) {:root {--font-size: 1.4rem;}} :root {
@media (pointer: none), (pointer: coarse) {:root {--font-size: 1.22rem;}} --font-size: 1.42rem;
@media (pointer: none), (pointer: coarse) and (max-width: 390px) {:root {--font-size: 1.16rem;}} }
@media (pointer: none), (pointer: coarse) and (max-width: 375px) {:root {--font-size: 1.11rem;}} }
@media (pointer: none), (pointer: coarse) and (max-width: 360px) {:root {--font-size: 1.06rem;}} @media (orientation: portrait) {
@media (pointer: none), (pointer: coarse) and (min-width: 780px) {:root {--font-size: 1.22rem;}} :root {
--font-size: 1.4rem;
}
}
@media (pointer: none), (pointer: coarse) {
:root {
--font-size: 1.22rem;
}
}
@media (pointer: none), (pointer: coarse) and (max-width: 390px) {
:root {
--font-size: 1.16rem;
}
}
@media (pointer: none), (pointer: coarse) and (max-width: 375px) {
:root {
--font-size: 1.11rem;
}
}
@media (pointer: none), (pointer: coarse) and (max-width: 360px) {
:root {
--font-size: 1.06rem;
}
}
@media (pointer: none), (pointer: coarse) and (min-width: 780px) {
:root {
--font-size: 1.22rem;
}
}
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
html { html {
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
@ -85,15 +116,21 @@ body {
} }
@media (pointer: none), (pointer: coarse) { @media (pointer: none), (pointer: coarse) {
body { background: var(--primary-background-color); } body {
background: var(--primary-background-color);
}
} }
::-webkit-scrollbar, .wrapper details::-webkit-scrollbar { ::-webkit-scrollbar,
.wrapper details::-webkit-scrollbar {
width: 0; width: 0;
height: 0; height: 0;
display: none; display: none;
} }
input:focus, select:focus, textarea:focus, button:focus { input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none; outline: none;
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
@ -103,18 +140,22 @@ input:focus, select:focus, textarea:focus, button:focus {
margin: 0 auto; margin: 0 auto;
min-height: calc(100vh - (var(--font-size) * var(--line-height) * (2.6 + 1))); min-height: calc(100vh - (var(--font-size) * var(--line-height) * (2.6 + 1)));
text-align: center; text-align: center;
padding: calc(var(--font-size) * var(--line-height) * 2.6) calc(var(--font-size) * var(--line-height) * 2.6) calc(var(--font-size) * var(--line-height)); padding: calc(var(--font-size) * var(--line-height) * 2.6)
calc(var(--font-size) * var(--line-height) * 2.6)
calc(var(--font-size) * var(--line-height));
} }
@media (pointer: none), (pointer: coarse) { @media (pointer: none), (pointer: coarse) {
.wrapper { .wrapper {
padding: calc(var(--font-size) * var(--line-height) * 2.2) calc(var(--font-size) * 1.8) 0; padding: calc(var(--font-size) * var(--line-height) * 2.2)
} calc(var(--font-size) * 1.8) 0;
}
} }
@media (pointer: none), (pointer: coarse) and (min-width: 780px) { @media (pointer: none), (pointer: coarse) and (min-width: 780px) {
.wrapper { .wrapper {
max-width: 22rem; max-width: 22rem;
padding: calc(var(--font-size) * var(--line-height) * 4.6) calc(var(--font-size) * 1.8) 0; padding: calc(var(--font-size) * var(--line-height) * 4.6)
} calc(var(--font-size) * 1.8) 0;
}
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
p { p {
@ -133,7 +174,7 @@ span.last {
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
p:first-child:first-letter { p:first-child:first-letter {
font-family: eb_garamond_initials, Times, serif; font-family: eb_garamond_initials, Times, serif;
float: left; float: left;
color: var(--primary-color); color: var(--primary-color);
display: inline; display: inline;
text-indent: 0; text-indent: 0;
@ -143,17 +184,20 @@ p:first-child:first-letter {
margin-right: calc(var(--font-size) * 0.32); margin-right: calc(var(--font-size) * 0.32);
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
a:link, .wrapper a:visited { a:link,
.wrapper a:visited {
outline: none; outline: none;
text-decoration: none; text-decoration: none;
color: var(--secondary-color); color: var(--secondary-color);
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
position: relative; position: relative;
} }
a:hover, .wrapper a:hover { a:hover,
.wrapper a:hover {
opacity: 50%; opacity: 50%;
} }
a.links, a.links:visited { a.links,
a.links:visited {
color: var(--text-color); color: var(--text-color);
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
@ -164,7 +208,7 @@ img {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
object-fit: contain; object-fit: contain;
padding-bottom: calc(var(--font-size) * var(--line-height) * -1 ); padding-bottom: calc(var(--font-size) * var(--line-height) * -1);
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
.sc { .sc {
@ -180,7 +224,7 @@ img {
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
a.footer { a.footer {
color: var(--primary-color); color: var(--primary-color);
display:flex; display: flex;
justify-content: right; justify-content: right;
padding-right: calc(var(--font-size) * 1.067); padding-right: calc(var(--font-size) * 1.067);
margin-top: calc(var(--font-size) * var(--line-height)); margin-top: calc(var(--font-size) * var(--line-height));
@ -188,7 +232,7 @@ a.footer {
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
.blog:first-child:first-letter { .blog:first-child:first-letter {
all:unset; all: unset;
} }
.blog { .blog {
text-align: center; text-align: center;
@ -198,7 +242,7 @@ a.footer {
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
table { table {
margin-top: calc(var(--font-size) * var(--line-height)); margin-top: calc(var(--font-size) * var(--line-height));
margin-bottom: calc(var(--font-size) * var(--line-height) * -1 ); margin-bottom: calc(var(--font-size) * var(--line-height) * -1);
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
} }
@ -244,44 +288,111 @@ ul li a::before {
position: absolute; position: absolute;
} }
@media (max-width: 350px) { @media (max-width: 350px) {
.list { .list {
text-align: left; text-align: left;
margin-left: calc(var(--font-size) * 1.067); margin-left: calc(var(--font-size) * 1.067);
} }
ul { ul {
column-count: 1; column-count: 1;
} }
} }
/*----------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------*/
ul li.Searxng a::before { content: "x";} ul li.Searxng a::before {
ul li.Nitter a::before { content: "n";} content: "x";
ul li.Voyager a::before { content: "v";} }
ul li.Mlmym a::before { content: "o";} ul li.Nitter a::before {
ul li.Photon a::before { content: "ph";} content: "n";
ul li.SimplyTranslate a::before { content: "t";} }
ul li.Gitea a::before { content: "#";} ul li.Voyager a::before {
ul li.Teddit a::before { content: "i";} content: "v";
ul li.Libreddit a::before { content: "l";} }
ul li.Binternet a::before { content: "bn";} ul li.Mlmym a::before {
ul li.Gothub a::before { content: "g";} content: "o";
ul li.AnonymousOverflow a::before { content: "a";} }
ul li.Send a::before { content: "s";} ul li.Photon a::before {
ul li.Privatebin a::before { content: "b";} content: "ph";
ul li.Etherpad a::before { content: "e";} }
ul li.StirlingPDF a::before { content: "p";} ul li.SimplyTranslate a::before {
ul li.ITTools a::before { content: "it";} content: "t";
ul li.Quetre a::before { content: "q";} }
ul li.Scribe a::before { content: "m";} ul li.Gitea a::before {
ul li.Libremdb a::before { content: "d";} content: "#";
ul li.Breezewiki a::before { content: "z";} }
ul li.Cinny a::before { content: "c";} ul li.Teddit a::before {
ul li.UptimeKuma a::before { content: "u";} content: "i";
ul li.Imgin a::before { content: "r";} }
ul li.Sourcecode a::before { content: "sc";} ul li.Libreddit a::before {
ul li.Fourget a::before { content: "4g";} content: "l";
ul li.Priviblur a::before { content: "tb";} }
ul li.Cloudtube a::before { content: "yt";} ul li.Binternet a::before {
ul li.Wolfree a::before { content: "wf";} content: "bn";
ul li.Proxigram a::before { content: "ig";} }
ul li.Proxitok a::before { content: "tt";} ul li.Gothub a::before {
ul li.Rat a::before { content: "ti";} content: "g";
}
ul li.AnonymousOverflow a::before {
content: "a";
}
ul li.Send a::before {
content: "s";
}
ul li.Privatebin a::before {
content: "b";
}
ul li.Etherpad a::before {
content: "e";
}
ul li.StirlingPDF a::before {
content: "p";
}
ul li.ITTools a::before {
content: "it";
}
ul li.Quetre a::before {
content: "q";
}
ul li.Scribe a::before {
content: "m";
}
ul li.Libremdb a::before {
content: "d";
}
ul li.Breezewiki a::before {
content: "z";
}
ul li.Cinny a::before {
content: "c";
}
ul li.UptimeKuma a::before {
content: "u";
}
ul li.Imgin a::before {
content: "r";
}
ul li.Sourcecode a::before {
content: "sc";
}
ul li.Fourget a::before {
content: "4g";
}
ul li.Priviblur a::before {
content: "tb";
}
ul li.Cloudtube a::before {
content: "yt";
}
ul li.Wolfree a::before {
content: "wf";
}
ul li.Proxigram a::before {
content: "ig";
}
ul li.Proxitok a::before {
content: "tt";
}
ul li.Rat a::before {
content: "ti";
}
ul li.Hckrnws a::before {
content: "hn";
}

View File

@ -21,6 +21,7 @@ date: 2023-01-01
- [Breeze&ZeroWidthSpace;wiki](https://z.opnxng.com){target="_blank"}{.links} {.Breezewiki} - [Breeze&ZeroWidthSpace;wiki](https://z.opnxng.com){target="_blank"}{.links} {.Breezewiki}
- [Proxigram](https://ig.opnxng.com){target="_blank"}{.links} {.Proxigram} - [Proxigram](https://ig.opnxng.com){target="_blank"}{.links} {.Proxigram}
- [Priviblur](https://tb.opnxng.com){target="_blank"}{.links} {.Priviblur} - [Priviblur](https://tb.opnxng.com){target="_blank"}{.links} {.Priviblur}
- [Hckrnws](https://hn.opnxng.com){target="_blank"}{.links} {.Hckrnws}
- [Voyager](https://v.opnxng.com){target="_blank"}{.links} {.Voyager} - [Voyager](https://v.opnxng.com){target="_blank"}{.links} {.Voyager}
- [Mlmym](https://o.opnxng.com){target="_blank"}{.links} {.Mlmym} - [Mlmym](https://o.opnxng.com){target="_blank"}{.links} {.Mlmym}
- [Photon](https://ph.opnxng.com){target="_blank"}{.links} {.Photon} - [Photon](https://ph.opnxng.com){target="_blank"}{.links} {.Photon}
@ -30,10 +31,10 @@ date: 2023-01-01
- [Gothub](https://g.opnxng.com){target="_blank"}{.links} {.Gothub} - [Gothub](https://g.opnxng.com){target="_blank"}{.links} {.Gothub}
- [R.A.T.](https://ti.opnxng.com){target="_blank"}{.links} {.Rat} - [R.A.T.](https://ti.opnxng.com){target="_blank"}{.links} {.Rat}
- [A.Over&ZeroWidthSpace;flow](https://a.opnxng.com){target="_blank"}{.links} {.AnonymousOverflow} - [A.Over&ZeroWidthSpace;flow](https://a.opnxng.com){target="_blank"}{.links} {.AnonymousOverflow}
- [Source Code](https://git.opnxng.com){target="_blank"}{.links} {.Gitea}
{.list} {.list}
<!-- <!--
- [Source Code](https://git.opnxng.com){target="_blank"}{.links} {.Gitea}
- [Teddit](https://i.opnxng.com){target="_blank"}{.links} {.Teddit} - [Teddit](https://i.opnxng.com){target="_blank"}{.links} {.Teddit}
- [Redlib](https://l.opnxng.com){target="_blank"}{.links} {.Libreddit} - [Redlib](https://l.opnxng.com){target="_blank"}{.links} {.Libreddit}
- [Cloudtube](https://yt.opnxng.com){target="_blank"}{.links} {.Cloudtube} - [Cloudtube](https://yt.opnxng.com){target="_blank"}{.links} {.Cloudtube}