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 CleanCSS = require("clean-css");
const htmlmin = require("html-minifier");
//const CleanCSS = require("clean-css");
const { minify } = require("html-minifier-terser");
const markdownIt = require("markdown-it");
const markdownItAttrs = require("markdown-it-attrs");
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 = {
html: true,
breaks: true,
linkify: true,
};
const markdownItAnchorOptions = {
level: 2, // minimum level header -- anchors will only be applied to h2 level headers and below but not h1
permalink: true,
};
const markdownItAnchorOptions = {
level: 2, // minimum level header -- anchors will only be applied to h2 level headers and below but not h1
permalink: true,
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",
"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 {
dir: {
input: "src",
includes: "_includes",
output: "site"
}
}
return {
dir: {
input: "src",
includes: "_includes",
output: "site",
},
};
eleventyConfig.addPassthroughCopy('/src/css')
return {
passthroughFileCopy: true
}
eleventyConfig.addPassthroughCopy("/src/css");
return {
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 \
@11ty/eleventy \
luxon \
html-minifier \
html-minifier-terser \
clean-css \
markdown-it-attrs \
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": {
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy": "^3.0.0",
"clean-css": "^5.3.3",
"html-minifier": "^4.0.0",
"html-minifier-terser": "^7.2.0",
"luxon": "^2.5.2",
"markdown-it-anchor": "^8.6.7",
"markdown-it-attrs": "^4.1.6",
"markdown-it-bracketed-spans": "^1.0.1",
"npm": "^10.8.1"
"npm": "^10.9.0"
}
}

View File

@ -2,7 +2,6 @@
layout: layout.njk
title: Opnxng | Blog
date: 2023-01-01
---
[![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-family: "eb_garamond_initials";
src: url("/css/fonts/ebgaramond-initials-webfont.woff2") format("woff2"),
url("/css/fonts/ebgaramond-initials-webfont.woff") format("woff");
src:
url("/css/fonts/ebgaramond-initials-webfont.woff2") format("woff2"),
url("/css/fonts/ebgaramond-initials-webfont.woff") format("woff");
unicode-range: U+0020-FB02;
}
@font-face {
font-family: "HeldaneText-Regular";
src: url("/css/fonts/HeldaneText-Regular.woff2") format("woff2"),
url("/css/fonts/HeldaneText-Regular.woff") format("woff");
src:
url("/css/fonts/HeldaneText-Regular.woff2") format("woff2"),
url("/css/fonts/HeldaneText-Regular.woff") format("woff");
unicode-range: U+0020-FB02;
}
@font-face {
font-family: "HeldaneText-RegularItalic";
src: url("/css/fonts/HeldaneText-RegularItalic.woff2") format("woff2"),
url("/css/fonts/HeldaneText-RegularItalic.woff") format("woff");
src:
url("/css/fonts/HeldaneText-RegularItalic.woff2") format("woff2"),
url("/css/fonts/HeldaneText-RegularItalic.woff") format("woff");
unicode-range: U+0020-FB02;
}
/*----------------------------------------------------------------------------------------------------*/
:root {
--line-height: 1.35;
--text-color: #262626;
--primary-background-color: #FFFFFF;
--secondary-background-color: #FAFAFA;
--primary-color: #20599E;
--secondary-color: #20599E;
--primary-background-color: #ffffff;
--secondary-background-color: #fafafa;
--primary-color: #20599e;
--secondary-color: #20599e;
}
@media (prefers-color-scheme: dark) {
:root {
--text-color: #D1D1CF;
--primary-background-color: #0E0E0F;
--secondary-background-color: #0E0E0F;
--primary-color: #1860A3;
--secondary-color: #1860A3;
}
--text-color: #d1d1cf;
--primary-background-color: #0e0e0f;
--secondary-background-color: #0e0e0f;
--primary-color: #1860a3;
--secondary-color: #1860a3;
}
}
/*----------------------------------------------------------------------------------------------------*/
@media (orientation: landscape) {:root {--font-size: 1.42rem;}}
@media (orientation: portrait) {: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;}}
@media (orientation: landscape) {
:root {
--font-size: 1.42rem;
}
}
@media (orientation: portrait) {
: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 {
-webkit-tap-highlight-color: transparent;
@ -85,15 +116,21 @@ body {
}
@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;
height: 0;
display: none;
}
input:focus, select:focus, textarea:focus, button:focus {
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}
/*----------------------------------------------------------------------------------------------------*/
@ -103,18 +140,22 @@ input:focus, select:focus, textarea:focus, button:focus {
margin: 0 auto;
min-height: calc(100vh - (var(--font-size) * var(--line-height) * (2.6 + 1)));
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) {
.wrapper {
padding: calc(var(--font-size) * var(--line-height) * 2.2) calc(var(--font-size) * 1.8) 0;
}
.wrapper {
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) {
.wrapper {
max-width: 22rem;
padding: calc(var(--font-size) * var(--line-height) * 4.6) calc(var(--font-size) * 1.8) 0;
}
.wrapper {
max-width: 22rem;
padding: calc(var(--font-size) * var(--line-height) * 4.6)
calc(var(--font-size) * 1.8) 0;
}
}
/*----------------------------------------------------------------------------------------------------*/
p {
@ -133,7 +174,7 @@ span.last {
/*----------------------------------------------------------------------------------------------------*/
p:first-child:first-letter {
font-family: eb_garamond_initials, Times, serif;
float: left;
float: left;
color: var(--primary-color);
display: inline;
text-indent: 0;
@ -143,17 +184,20 @@ p:first-child:first-letter {
margin-right: calc(var(--font-size) * 0.32);
}
/*----------------------------------------------------------------------------------------------------*/
a:link, .wrapper a:visited {
a:link,
.wrapper a:visited {
outline: none;
text-decoration: none;
color: var(--secondary-color);
-webkit-tap-highlight-color: transparent;
position: relative;
}
a:hover, .wrapper a:hover {
a:hover,
.wrapper a:hover {
opacity: 50%;
}
a.links, a.links:visited {
a.links,
a.links:visited {
color: var(--text-color);
}
/*----------------------------------------------------------------------------------------------------*/
@ -164,7 +208,7 @@ img {
display: block;
margin: 0 auto;
object-fit: contain;
padding-bottom: calc(var(--font-size) * var(--line-height) * -1 );
padding-bottom: calc(var(--font-size) * var(--line-height) * -1);
}
/*----------------------------------------------------------------------------------------------------*/
.sc {
@ -180,7 +224,7 @@ img {
/*----------------------------------------------------------------------------------------------------*/
a.footer {
color: var(--primary-color);
display:flex;
display: flex;
justify-content: right;
padding-right: calc(var(--font-size) * 1.067);
margin-top: calc(var(--font-size) * var(--line-height));
@ -188,7 +232,7 @@ a.footer {
}
/*----------------------------------------------------------------------------------------------------*/
.blog:first-child:first-letter {
all:unset;
all: unset;
}
.blog {
text-align: center;
@ -198,7 +242,7 @@ a.footer {
/*----------------------------------------------------------------------------------------------------*/
table {
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%;
border-collapse: collapse;
}
@ -244,44 +288,111 @@ ul li a::before {
position: absolute;
}
@media (max-width: 350px) {
.list {
text-align: left;
margin-left: calc(var(--font-size) * 1.067);
}
ul {
column-count: 1;
}
.list {
text-align: left;
margin-left: calc(var(--font-size) * 1.067);
}
ul {
column-count: 1;
}
}
/*----------------------------------------------------------------------------------------------------*/
ul li.Searxng a::before { content: "x";}
ul li.Nitter a::before { content: "n";}
ul li.Voyager a::before { content: "v";}
ul li.Mlmym a::before { content: "o";}
ul li.Photon a::before { content: "ph";}
ul li.SimplyTranslate a::before { content: "t";}
ul li.Gitea a::before { content: "#";}
ul li.Teddit a::before { content: "i";}
ul li.Libreddit a::before { content: "l";}
ul li.Binternet a::before { content: "bn";}
ul li.Gothub a::before { 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.Searxng a::before {
content: "x";
}
ul li.Nitter a::before {
content: "n";
}
ul li.Voyager a::before {
content: "v";
}
ul li.Mlmym a::before {
content: "o";
}
ul li.Photon a::before {
content: "ph";
}
ul li.SimplyTranslate a::before {
content: "t";
}
ul li.Gitea a::before {
content: "#";
}
ul li.Teddit a::before {
content: "i";
}
ul li.Libreddit a::before {
content: "l";
}
ul li.Binternet a::before {
content: "bn";
}
ul li.Gothub a::before {
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}
- [Proxigram](https://ig.opnxng.com){target="_blank"}{.links} {.Proxigram}
- [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}
- [Mlmym](https://o.opnxng.com){target="_blank"}{.links} {.Mlmym}
- [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}
- [R.A.T.](https://ti.opnxng.com){target="_blank"}{.links} {.Rat}
- [A.Over&ZeroWidthSpace;flow](https://a.opnxng.com){target="_blank"}{.links} {.AnonymousOverflow}
- [Source Code](https://git.opnxng.com){target="_blank"}{.links} {.Gitea}
{.list}
<!--
- [Source Code](https://git.opnxng.com){target="_blank"}{.links} {.Gitea}
- [Teddit](https://i.opnxng.com){target="_blank"}{.links} {.Teddit}
- [Redlib](https://l.opnxng.com){target="_blank"}{.links} {.Libreddit}
- [Cloudtube](https://yt.opnxng.com){target="_blank"}{.links} {.Cloudtube}