Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06a50db987 | ||
|
|
63a171aefd | ||
|
|
b21390b1a4 | ||
|
|
b547cd3137 | ||
|
|
7a5c031b1d | ||
|
|
35e9dfe24b
|
||
|
|
9d75020029
|
||
|
|
28b072bcf2
|
||
|
|
9a1ccec281
|
||
|
|
cb324f6540
|
||
|
|
ccea55348a
|
||
|
|
4b5b061e49
|
||
|
|
6d441544cd
|
||
|
|
f77d618553
|
||
|
|
c4263762c7
|
||
|
|
1a9df45e55
|
||
|
|
d5d7f74fd0
|
||
|
|
934c4f4de3
|
||
|
|
1ff611b3ed
|
||
|
|
e2372b378a
|
||
|
|
c4d3194a7f
|
||
|
|
252f5143d1
|
||
|
|
9a0cf62882
|
||
|
|
c267ec35a4
|
||
|
|
fd867c7262
|
||
|
|
3bdc78303d
|
||
|
|
4aafc98be9
|
||
|
|
84bae3759d
|
||
|
|
98ff90f460
|
||
|
|
ab55d75296
|
||
|
|
f69df643f7
|
||
|
|
2e328133cc
|
||
|
|
ac1744869d
|
||
|
|
68e1e77843
|
||
|
|
675f56d9c5
|
||
|
|
7bf40c1263
|
||
|
|
3586eeb6bf
|
||
|
|
ee9a16865e
|
||
|
|
a1533640cf
|
||
|
|
d48d4dcb14
|
||
|
|
bdd2e8c79a
|
||
|
|
b36d394308
|
||
|
|
a8295a7321
|
||
|
|
a3f0a74535
|
||
|
|
0e5cce4a52
|
||
|
|
2007c280c8
|
||
|
|
03aadb59fe
|
||
|
|
0f90c7c0d0 | ||
|
|
fbf3657b77
|
||
|
|
21f1d9216c
|
||
|
|
0bd69bd3f3
|
||
|
|
de146693aa
|
||
|
|
57bd0f0fcc
|
||
|
|
41e4d4dab0
|
||
|
|
176a5855de
|
||
|
|
1b2e0d7501
|
||
|
|
db94ace86e | ||
|
|
60babf9451
|
||
|
|
b5d6232b59
|
||
|
|
3a123ab8ee
|
||
|
|
652cee0e2e
|
||
|
|
080912401b
|
||
|
|
8acfafab45
|
||
|
|
0e97c82aa1
|
||
|
|
6307509542 | ||
|
|
118c8f89c0
|
||
|
|
1a4c18cce0
|
||
|
|
0aaf47909f
|
||
|
|
186bdde093
|
||
|
|
f99cd77e20
|
||
|
|
c4dc1d26d2
|
||
|
|
2bf4389d37 | ||
|
|
f1a7bd7dff | ||
|
|
8d1aec32f6 | ||
|
|
b631a8e782 | ||
|
|
cc792b244b | ||
|
|
0b0c028954 | ||
|
|
d01a3f227c | ||
|
|
36a58be0f1 | ||
|
|
c8f30073d9 | ||
|
|
b0e84f281d | ||
|
|
c10c858988 | ||
|
|
eeebcd3472 | ||
|
|
04e9e1fd14 | ||
|
|
fb419d0bea | ||
|
|
193625958a |
No files matched your search
@@ -1 +0,0 @@
|
||||
nodejs 12.22.4
|
||||
@@ -1,9 +1,14 @@
|
||||
FROM node:12-alpine
|
||||
FROM node:22-alpine
|
||||
|
||||
RUN apk update && apk add python3 make gcc g++
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ADD package.json .
|
||||
RUN npm install --production
|
||||
|
||||
ADD . .
|
||||
|
||||
RUN npm install
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["npm", "start"]
|
||||
@@ -1,6 +1,6 @@
|
||||
.DEFAULT_GOAL := default
|
||||
|
||||
IMAGE ?= docker.cloud.cluster.fun/averagemarcus/blog:latest
|
||||
IMAGE ?= rg.fr-par.scw.cloud/averagemarcus/blog:latest
|
||||
|
||||
.PHONY: test # Run all tests, linting and format checks
|
||||
test: lint check-format run-tests
|
||||
@@ -38,8 +38,8 @@ docker-publish:
|
||||
@docker push $(IMAGE)
|
||||
|
||||
.PHONY: run # Run the application
|
||||
run:
|
||||
@npm start
|
||||
run: docker-build
|
||||
@docker run --rm -it -p 8000:8000 $(IMAGE)
|
||||
|
||||
.PHONY: ci # Perform CI specific tasks to perform on a pull request
|
||||
ci:
|
||||
@@ -47,7 +47,7 @@ ci:
|
||||
|
||||
.PHONY: release # Release the latest version of the application
|
||||
release:
|
||||
@kubectl --namespace blog set image deployment blog web=docker.cluster.fun/averagemarcus/blog:$(SHA)
|
||||
@kubectl --namespace blog set image deployment blog web=rg.fr-par.scw.cloud/averagemarcus/blog:$(SHA)
|
||||
|
||||
.PHONY: help # Show this list of commands
|
||||
help:
|
||||
|
||||
@@ -1,146 +1,509 @@
|
||||
"use strict";
|
||||
const fs = require('fs');
|
||||
const https = require('https');
|
||||
const express = require('express');
|
||||
const compress = require('compression');
|
||||
const app = express();
|
||||
const Metalsmith = require('metalsmith');
|
||||
const inplace = require('metalsmith-in-place');
|
||||
const layouts = require('metalsmith-layouts');
|
||||
const markdown = require('metalsmith-markdownit');
|
||||
const permalinks = require('metalsmith-permalinks');
|
||||
const collections = require('metalsmith-collections');
|
||||
const pagination = require('metalsmith-pagination');
|
||||
const define = require('metalsmith-define');
|
||||
const feed = require('metalsmith-feed');
|
||||
const sass = require('metalsmith-sass');
|
||||
const date = require('metalsmith-build-date');
|
||||
const sitemap = require('metalsmith-sitemap');
|
||||
const Handlebars = require('handlebars');
|
||||
const emoji = require('markdown-it-emoji');
|
||||
const moment = require('moment');
|
||||
const striptags = require('striptags');
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const express = require("express");
|
||||
const compress = require("compression");
|
||||
const Metalsmith = require("metalsmith");
|
||||
const matter = require("gray-matter");
|
||||
const inPlace = require("@metalsmith/in-place");
|
||||
const layouts = require("@metalsmith/layouts");
|
||||
const markdown = require("@metalsmith/markdown");
|
||||
const permalinks = require("./plugins/permalinks");
|
||||
const collections = require("@metalsmith/collections");
|
||||
const pagination = require("metalsmith-pagination");
|
||||
const define = require("metalsmith-define");
|
||||
const sitemap = require("metalsmith-sitemap");
|
||||
const Handlebars = require("handlebars");
|
||||
const moment = require("moment");
|
||||
const striptags = require("striptags");
|
||||
const { marked } = require("marked");
|
||||
const RSS = require("rss");
|
||||
const sass = require("sass");
|
||||
|
||||
const port = process.env.PORT || 8000;
|
||||
|
||||
const app = express();
|
||||
|
||||
app.disable("x-powered-by");
|
||||
app.use(compress());
|
||||
app.use(express.static(__dirname + '/build'));
|
||||
app.use(express.static(__dirname + "/build"));
|
||||
|
||||
// Lets try and slow down some of those exploit crawlers
|
||||
app.use("/", require('./filterRoutes'));
|
||||
app.use("/", require("./filterRoutes"));
|
||||
|
||||
app.get("/robots.txt", function(req, res) {
|
||||
res.send("User-agent: * Disallow: ");
|
||||
})
|
||||
// Redirects
|
||||
app.use("/", require("./redirects"));
|
||||
|
||||
app.get(/\/(feed|rss)\/?$/, function(req, res) {
|
||||
res.redirect('/feed.xml');
|
||||
})
|
||||
|
||||
app.get("/healthz", function(req, res) {
|
||||
res.sendStatus(200);
|
||||
})
|
||||
|
||||
var md = markdown({html: true});
|
||||
md.parser.use(emoji);
|
||||
|
||||
Handlebars.registerHelper('markdown', function(text) {
|
||||
if(!text) return;
|
||||
return md.parser.render(text);
|
||||
// Handle some iOS icon 404s
|
||||
app.get("/apple-touch-icon*", function (req, res) {
|
||||
res.sendFile(__dirname + "/build/images/favico/" + req.url, () => {
|
||||
res.sendFile(__dirname + "/build/images/favico/apple-touch-icon.png");
|
||||
});
|
||||
});
|
||||
Handlebars.registerHelper('moment', function(date, format) {
|
||||
app.get("/images/favico/*.png", function (req, res) {
|
||||
res.sendFile(__dirname + "/build/images/favico/apple-touch-icon.png");
|
||||
});
|
||||
|
||||
app.get("/favicon.png", function (req, res) {
|
||||
res.sendFile(__dirname + "/build/images/favico/apple-touch-icon.png");
|
||||
});
|
||||
|
||||
app.get("/robots.txt", function (req, res) {
|
||||
res.send("User-agent: * Disallow: ");
|
||||
});
|
||||
|
||||
app.get(
|
||||
/\/(feeds?|rss|atom)\/?|feed\.xml|rss\.xml|index\.rss|feed\.rss$/,
|
||||
function (req, res) {
|
||||
res.redirect(301, "/feed.xml");
|
||||
}
|
||||
);
|
||||
|
||||
app.get(/.+\/manifest\.json$/, function (req, res) {
|
||||
res.redirect(301, "/manifest.json");
|
||||
});
|
||||
|
||||
app.get("/healthz", function (req, res) {
|
||||
res.sendStatus(200);
|
||||
});
|
||||
|
||||
// --- Markdown renderer setup ---
|
||||
marked.setOptions({
|
||||
gfm: true,
|
||||
breaks: true,
|
||||
});
|
||||
|
||||
const renderer = new marked.Renderer();
|
||||
|
||||
// Custom table renderer to add role="grid" (matches original behavior)
|
||||
const originalTable = renderer.table.bind(renderer);
|
||||
renderer.table = function (e) {
|
||||
let result = originalTable(e);
|
||||
return result.replace("<table>", '<table role="grid">');
|
||||
};
|
||||
|
||||
const customRenderer = (source, _opts, _context) => {
|
||||
return marked.parse(source, { renderer });
|
||||
};
|
||||
|
||||
// --- Handlebars helpers ---
|
||||
Handlebars.registerHelper("markdown", function (text) {
|
||||
if (!text) return;
|
||||
return customRenderer(text, {}, {});
|
||||
});
|
||||
Handlebars.registerHelper("moment", function (date, format) {
|
||||
return new moment(date).format(format);
|
||||
});
|
||||
Handlebars.registerHelper("striptags", function(text){
|
||||
return striptags(text);
|
||||
Handlebars.registerHelper("striptags", function (text) {
|
||||
return striptags(text);
|
||||
});
|
||||
Handlebars.registerHelper("buildTitle", function(title, siteTitle){
|
||||
if (title.indexOf(siteTitle) < 0) {
|
||||
title = `'${title}' by ${siteTitle}`;
|
||||
Handlebars.registerHelper("buildTitle", function (title, siteTitle) {
|
||||
if (title.indexOf(siteTitle) < 0) {
|
||||
title = "'" + title + "' by " + siteTitle;
|
||||
}
|
||||
return title;
|
||||
});
|
||||
Handlebars.registerHelper("jointags", function(tags){
|
||||
return (tags || '').split(' ').join(',');
|
||||
Handlebars.registerHelper("jointags", function (tags) {
|
||||
return (tags || "").split(" ").join(",");
|
||||
});
|
||||
Handlebars.registerHelper("encodetitle", function (str) {
|
||||
return (str || "").replaceAll(" ", "%2B");
|
||||
});
|
||||
|
||||
Metalsmith(__dirname)
|
||||
.use(define({
|
||||
site: {
|
||||
title: 'Marcus Noble',
|
||||
description: 'Awesomeness with a side of geek',
|
||||
url: 'https://marcusnoble.co.uk'
|
||||
}
|
||||
}))
|
||||
.use(date())
|
||||
.use(collections({
|
||||
posts: {
|
||||
pattern: 'posts/*',
|
||||
sortBy: 'date',
|
||||
reverse: true,
|
||||
},
|
||||
drafts: {
|
||||
pattern: 'drafts/*',
|
||||
sortBy: 'date',
|
||||
reverse: true,
|
||||
},
|
||||
projects: {
|
||||
pattern: 'projects/*'
|
||||
},
|
||||
pages: {
|
||||
pattern: 'pages/*'
|
||||
}
|
||||
}))
|
||||
.use(inplace({
|
||||
engine: 'handlebars',
|
||||
directory: 'templates',
|
||||
partials: 'templates/partials'
|
||||
}))
|
||||
.use(md)
|
||||
.use(permalinks({
|
||||
pattern: ':date-:title',
|
||||
date: 'YYYY-MM-DD',
|
||||
linksets: [
|
||||
{
|
||||
match: { collection: 'pages' },
|
||||
pattern: ':title'
|
||||
},
|
||||
{
|
||||
match: { collection: 'drafts' },
|
||||
pattern: 'drafts/:title'
|
||||
}
|
||||
]
|
||||
}))
|
||||
.use(feed({
|
||||
collection: 'posts',
|
||||
destination: 'feed.xml'
|
||||
}))
|
||||
.use(sitemap({
|
||||
hostname: 'https://marcusnoble.co.uk',
|
||||
modifiedProperty: 'date'
|
||||
}))
|
||||
.use(pagination({
|
||||
'collections.posts': {
|
||||
perPage: 5,
|
||||
layout: 'index.html',
|
||||
first: 'index.html',
|
||||
noPageOne: true,
|
||||
path: 'page:num/index.html',
|
||||
pageMetadata: {
|
||||
title: 'Posts'
|
||||
}
|
||||
}
|
||||
}))
|
||||
.use(layouts({
|
||||
engine: 'handlebars',
|
||||
directory: 'templates',
|
||||
partials: 'templates/partials'
|
||||
}))
|
||||
.use(sass())
|
||||
.build(function(err) {
|
||||
if (err) throw err;
|
||||
// --- Pre-build: Compile SCSS to CSS ---
|
||||
function compileSass(sourceDir, outputDir) {
|
||||
const cssDir = path.join(sourceDir, "src", "css");
|
||||
const outputCssDir = path.join(outputDir, "css");
|
||||
|
||||
app.listen(port, function () {
|
||||
console.log(`App listening at http://localhost:${port}`);
|
||||
if (!fs.existsSync(cssDir)) {
|
||||
console.warn("No CSS source directory found, skipping SCSS compilation");
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure output directory exists
|
||||
if (!fs.existsSync(outputCssDir)) {
|
||||
fs.mkdirSync(outputCssDir, { recursive: true });
|
||||
}
|
||||
|
||||
const files = fs.readdirSync(cssDir);
|
||||
fs.mkdirSync(outputCssDir, { recursive: true });
|
||||
|
||||
for (const file of files) {
|
||||
if (!file.endsWith(".scss") || file.startsWith("_")) continue; // Skip partials
|
||||
|
||||
const inputPath = path.join(cssDir, file);
|
||||
const outputFileName = file.replace(/\.scss$/, ".css");
|
||||
const outputPath = path.join(outputCssDir, outputFileName);
|
||||
|
||||
console.log(`Compiling SCSS: ${file} -> ${outputFileName}`);
|
||||
try {
|
||||
const result = sass.compile(inputPath, {
|
||||
style: "compressed",
|
||||
});
|
||||
fs.writeFileSync(outputPath, result.css);
|
||||
} catch (err) {
|
||||
console.error(`Failed to compile ${file}:`, err.message);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Feed generation plugin ---
|
||||
function feedPlugin() {
|
||||
return function (files, metalsmith, done) {
|
||||
const posts = metalsmith.metadata().collections.posts || [];
|
||||
|
||||
const feed = new RSS({
|
||||
title: "Marcus Noble",
|
||||
description:
|
||||
"The blog of Marcus Noble, self-described tinkerer, platform engineer and all round average guy!",
|
||||
site_url: "https://marcusnoble.co.uk",
|
||||
feed_url: "https://marcusnoble.co.uk/feed.xml",
|
||||
image_url: "https://marcusnoble.co.uk/images/marcus.jpg",
|
||||
language: "en",
|
||||
});
|
||||
|
||||
posts.forEach((post) => {
|
||||
const postUrl = `https://marcusnoble.co.uk/${post.path}/`;
|
||||
feed.item({
|
||||
title: post.title,
|
||||
url: postUrl,
|
||||
guid: postUrl,
|
||||
date: post.date.toISOString(),
|
||||
description: post.summary || "",
|
||||
categories: (post.tags || "").split(" ").filter(Boolean),
|
||||
});
|
||||
});
|
||||
|
||||
files["feed.xml"] = {
|
||||
contents: Buffer.from(feed.xml({ indent: true })),
|
||||
modified: new Date(),
|
||||
};
|
||||
|
||||
done();
|
||||
};
|
||||
}
|
||||
|
||||
// --- Handlebars partials preprocessor ---
|
||||
// Processes {{> partial }} calls in markdown files before markdown rendering
|
||||
function handlebarsPreprocessor() {
|
||||
return function (files, metalsmith, done) {
|
||||
const templateDir = path.join(metalsmith.directory(), "templates");
|
||||
const partialsDir = path.join(templateDir, "partials");
|
||||
|
||||
// Load all partials
|
||||
const hbs = Handlebars.create();
|
||||
hbs.registerHelper("markdown", function (text) {
|
||||
if (!text) return "";
|
||||
return customRenderer(text, {}, {});
|
||||
});
|
||||
hbs.registerHelper("moment", function (date, format) {
|
||||
return new moment(date).format(format);
|
||||
});
|
||||
hbs.registerHelper("striptags", striptags);
|
||||
hbs.registerHelper("buildTitle", function (title, siteTitle) {
|
||||
if (title.indexOf(siteTitle) < 0) {
|
||||
title = "'" + title + "' by " + siteTitle;
|
||||
}
|
||||
return title;
|
||||
});
|
||||
hbs.registerHelper("jointags", function (tags) {
|
||||
return (tags || "").split(" ").join(",");
|
||||
});
|
||||
hbs.registerHelper("encodetitle", function (str) {
|
||||
return (str || "").replaceAll(" ", "%2B");
|
||||
});
|
||||
|
||||
// Register all partials
|
||||
if (fs.existsSync(partialsDir)) {
|
||||
const partialFiles = fs.readdirSync(partialsDir);
|
||||
for (const file of partialFiles) {
|
||||
const name = path.parse(file).name;
|
||||
const content = fs.readFileSync(path.join(partialsDir, file), "utf8");
|
||||
hbs.registerPartial(name, content);
|
||||
}
|
||||
}
|
||||
|
||||
// Find markdown files with partial references and process them
|
||||
const filesToProcess = Object.keys(files).filter((file) =>
|
||||
file.endsWith(".md") || file.endsWith(".markdown")
|
||||
);
|
||||
|
||||
for (const file of filesToProcess) {
|
||||
const content = files[file].contents.toString();
|
||||
const handlebarsRegex = /\{\{\s*>\s*(\w+)\s+([^}]*)\s*\}\}/g;
|
||||
const matches = [...content.matchAll(handlebarsRegex)];
|
||||
|
||||
if (matches.length > 0) {
|
||||
let processed = content;
|
||||
for (const match of matches) {
|
||||
const partialName = match[1];
|
||||
const argsStr = match[2];
|
||||
// Parse arguments: name="value" name="value" ...
|
||||
const args = {};
|
||||
const argRegex = /(\w+)=["']([^"']*)["']/g;
|
||||
let argMatch;
|
||||
while ((argMatch = argRegex.exec(argsStr)) !== null) {
|
||||
args[argMatch[1]] = argMatch[2];
|
||||
}
|
||||
try {
|
||||
const partial = hbs.partials[partialName];
|
||||
if (partial) {
|
||||
const rendered = hbs.compile(partial)(args);
|
||||
processed = processed.replace(match[0], rendered);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
`Warning: Could not render partial ${partialName} in ${file}`
|
||||
);
|
||||
}
|
||||
}
|
||||
files[file].contents = Buffer.from(processed);
|
||||
}
|
||||
}
|
||||
|
||||
// Extract date and title from filename for permalinks compatibility
|
||||
// The filename date is the primary source for the permalink
|
||||
const postPattern = /^posts\/(\d{4}-\d{2}-\d{2})-(.+)\.(md|markdown)$/;
|
||||
for (const file of Object.keys(files)) {
|
||||
const match = file.match(postPattern);
|
||||
if (match) {
|
||||
const [, dateStr, titleSlug] = match;
|
||||
// Use filename date for permalink (via _filenameDate), but front matter date for other purposes
|
||||
// Store filename-based date for permalinks
|
||||
if (!files[file]._filenameDate) {
|
||||
files[file]._filenameDate = new Date(dateStr);
|
||||
}
|
||||
// Also store the filename-based title slug for permalinks
|
||||
if (!files[file]._filenameTitle) {
|
||||
files[file]._filenameTitle = titleSlug;
|
||||
}
|
||||
// Set the title from front matter (or derive from filename)
|
||||
if (!files[file].title) {
|
||||
// Convert slug to title: "some-title-slug" -> "Some Title Slug"
|
||||
files[file].title = titleSlug
|
||||
.split("-")
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join(" ");
|
||||
}
|
||||
}
|
||||
// Set default date for files without one (e.g., index.html from pagination, pages)
|
||||
if (!files[file].date) {
|
||||
files[file].date = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
done();
|
||||
};
|
||||
}
|
||||
|
||||
// --- Metalsmith build pipeline ---
|
||||
// Pre-build: Compile SCSS to CSS and write to build directory
|
||||
compileSass(__dirname, path.join(__dirname, "build"));
|
||||
|
||||
const ms = Metalsmith(__dirname)
|
||||
.ignore(['**/*.scss']) // Don't copy SCSS source files to build
|
||||
.clean(false) // Don't clean build directory (pre-build SCSS compilation outputs preserved)
|
||||
.source("src")
|
||||
.use(
|
||||
define({
|
||||
site: {
|
||||
title: "Marcus Noble",
|
||||
description:
|
||||
"The blog of Marcus Noble, self-described tinkerer, platform engineer and all round average guy!",
|
||||
url: "https://marcusnoble.co.uk",
|
||||
},
|
||||
})
|
||||
)
|
||||
.use(function (files, metalsmith, done) {
|
||||
const now = new Date();
|
||||
const meta = metalsmith.metadata();
|
||||
meta.buildDate = now;
|
||||
meta.buildTimestamp = now.toISOString();
|
||||
done();
|
||||
})
|
||||
.use(
|
||||
collections({
|
||||
posts: {
|
||||
pattern: "posts/*.{md,markdown}",
|
||||
sort: "date:desc",
|
||||
},
|
||||
drafts: {
|
||||
pattern: "drafts/*.{md,markdown}",
|
||||
sort: "date:desc",
|
||||
},
|
||||
projects: {
|
||||
pattern: "projects/*",
|
||||
},
|
||||
pages: {
|
||||
pattern: "pages/*",
|
||||
},
|
||||
})
|
||||
)
|
||||
.use(function (files, metalsmith, done) {
|
||||
// Extract YAML front matter from all markdown files
|
||||
Object.keys(files).forEach(function (file) {
|
||||
if (file.endsWith(".md") || file.endsWith(".markdown")) {
|
||||
const content = files[file].contents.toString();
|
||||
const parsed = matter(content);
|
||||
// Update file content to body (without front matter)
|
||||
files[file].contents = Buffer.from(parsed.content);
|
||||
// Extract front matter as file metadata
|
||||
if (parsed.data) {
|
||||
Object.assign(files[file], parsed.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
done();
|
||||
})
|
||||
.use(handlebarsPreprocessor())
|
||||
.use(
|
||||
markdown({
|
||||
render: customRenderer,
|
||||
})
|
||||
)
|
||||
.use(
|
||||
pagination({
|
||||
"collections.posts": {
|
||||
perPage: 5,
|
||||
layout: "index.html",
|
||||
first: "index.html",
|
||||
noPageOne: true,
|
||||
path: "page:num/index.html",
|
||||
pageMetadata: {
|
||||
title: "Posts",
|
||||
},
|
||||
},
|
||||
})
|
||||
)
|
||||
.use(function (files, metalsmith, done) {
|
||||
// Pre-compute paths for layouts rendering
|
||||
// This mirrors the permalinks logic but doesn't rename files
|
||||
const slugRe = /[<>:"'\|?*]|[^\w\s$_+~.()!\-@]+/g;
|
||||
const linksets = [
|
||||
{ match: { collection: "pages" }, pattern: ":title" },
|
||||
{ match: { collection: "drafts" }, pattern: "drafts/:title" },
|
||||
];
|
||||
for (const file of Object.keys(files)) {
|
||||
const data = files[file];
|
||||
|
||||
// Set default date
|
||||
if (!data.date) {
|
||||
data.date = new Date();
|
||||
}
|
||||
|
||||
// Skip non-HTML files
|
||||
if (!file.endsWith(".html")) continue;
|
||||
if (data.permalink === false) continue;
|
||||
|
||||
// Skip layout files (layout matches filename)
|
||||
const baseName = path.basename(file, ".html");
|
||||
// Don't skip index.html - it already has permalink from pagination
|
||||
if (file === "index.html") {
|
||||
// Set path for index page (root URL)
|
||||
data.path = "";
|
||||
continue;
|
||||
}
|
||||
if (data.layout === baseName || data.layout === `${baseName}.html`) continue;
|
||||
|
||||
// Determine linkset
|
||||
let linkset = null;
|
||||
for (const ls of linksets) {
|
||||
if (ls.match) {
|
||||
let matched = true;
|
||||
for (const [key, val] of Object.entries(ls.match)) {
|
||||
const fileVal = data[key];
|
||||
if (Array.isArray(fileVal)) {
|
||||
if (!fileVal.includes(val)) { matched = false; break; }
|
||||
} else if (fileVal !== val) { matched = false; break; }
|
||||
}
|
||||
if (matched) { linkset = ls; break; }
|
||||
}
|
||||
}
|
||||
const pattern = linkset ? (linkset.pattern || ":date-:title") : ":date-:title";
|
||||
|
||||
// Compute permalink
|
||||
let result = pattern
|
||||
.replace(/:(\w+)(\??)/g, (match, key, optional) => {
|
||||
let value = data[key];
|
||||
if (value === undefined || value === null) {
|
||||
if (optional) return "";
|
||||
return key;
|
||||
}
|
||||
if (key === "date" && data._filenameDate) {
|
||||
const d = data._filenameDate;
|
||||
return d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0");
|
||||
}
|
||||
if (value instanceof Date) {
|
||||
const d = value;
|
||||
return d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0");
|
||||
}
|
||||
return String(value).toLowerCase().replace(/\s+/g, "-").replace(slugRe, "").replace(/-+/g, "-");
|
||||
})
|
||||
.replace(/\/+$/, "");
|
||||
|
||||
// Add directory index - force index.html for permalinks without .html extension
|
||||
// Dots in titles (like T.I.L.) confuse path.extname() so we check the actual extension
|
||||
if (!result.endsWith(".html")) {
|
||||
result = path.join(result, "index.html");
|
||||
}
|
||||
|
||||
// Post files: no prefix - URLs match production format /YYYY-MM-DD-slug/
|
||||
data.permalink = result;
|
||||
|
||||
// Set path for templates (permalink without index.html)
|
||||
if (data.permalink.endsWith("/index.html")) {
|
||||
data.path = data.permalink.replace(/\/index\.html$/, "");
|
||||
} else if (path.extname(data.permalink) === ".html") {
|
||||
data.path = data.permalink.replace(/\.html$/, "");
|
||||
} else {
|
||||
data.path = data.permalink;
|
||||
}
|
||||
}
|
||||
done();
|
||||
})
|
||||
.use(
|
||||
layouts({
|
||||
transform: require("./plugins/handlebars-html"),
|
||||
directory: "templates",
|
||||
pattern: "**/*.html",
|
||||
extname: ".html",
|
||||
})
|
||||
)
|
||||
.use(
|
||||
permalinks({
|
||||
pattern: ":date-:title",
|
||||
date: "YYYY-MM-DD",
|
||||
linksets: [
|
||||
{
|
||||
match: { collection: "pages" },
|
||||
pattern: ":title"
|
||||
},
|
||||
{
|
||||
match: { collection: "drafts" },
|
||||
pattern: "drafts/:title"
|
||||
}
|
||||
]
|
||||
})
|
||||
)
|
||||
.use(
|
||||
sitemap({
|
||||
hostname: "https://marcusnoble.co.uk",
|
||||
omitExtension: true,
|
||||
})
|
||||
)
|
||||
.use(feedPlugin());
|
||||
|
||||
// Run the build
|
||||
ms.build(function (err) {
|
||||
if (err) {
|
||||
console.error("Build failed:", err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
console.log("Build complete. Starting server...");
|
||||
|
||||
app.listen(port, function () {
|
||||
console.log(`App listening at http://localhost:${port}`);
|
||||
});
|
||||
});
|
||||
@@ -1,35 +1,88 @@
|
||||
const express = require('express');
|
||||
const express = require("express");
|
||||
const router = express.Router();
|
||||
const blackHole = function (req, res) {
|
||||
res.redirect("https://crawler-test.com/redirects/infinite_redirect");
|
||||
res.redirect("https://crawler-test.com/redirects/infinite_redirect");
|
||||
};
|
||||
|
||||
router.all('(/*)?/wp-admin/', blackHole);
|
||||
router.all(/.*\.php$/, blackHole);
|
||||
router.all(/.*\.aspx$/, blackHole);
|
||||
router.all(/.*\.gz$/, blackHole);
|
||||
router.all(/.*\.bz2$/, blackHole);
|
||||
router.all(/.*\.tar$/, blackHole);
|
||||
router.all(/.*\.sql$/, blackHole);
|
||||
router.all('(/*)?/wp-includes/(*)?', blackHole);
|
||||
router.all('/.git/*?', blackHole);
|
||||
router.all('/.env', blackHole);
|
||||
router.all('/autodiscover/autodiscover.xml', blackHole)
|
||||
router.all('/.well-known/autoconfig(/.*)?', blackHole)
|
||||
router.all('/admin(/.*)?', blackHole)
|
||||
router.all('/wordpress/', blackHole);
|
||||
router.all('/wp(2)?/', blackHole);
|
||||
router.all('/backup/', blackHole);
|
||||
router.all('/db-backup/', blackHole);
|
||||
router.all('/db_backup/', blackHole);
|
||||
router.all('/sql-backup/', blackHole);
|
||||
router.all(/.*\/dbbackup\/.*/, blackHole);
|
||||
router.all('/bak/', blackHole);
|
||||
router.all(/.*\/mail\/config-.+\.xml/, blackHole);
|
||||
router.all(/archive\.zip/, blackHole);
|
||||
router.post('*', blackHole);
|
||||
router.put('*', blackHole);
|
||||
router.delete('*', blackHole);
|
||||
// Specifically allow, but mark as not-found, any `/.well-known/` paths
|
||||
router.all(/^\/\.well-known\//, function (req, res) {
|
||||
res.sendStatus(404);
|
||||
});
|
||||
|
||||
// Block access to any root-level dot files
|
||||
router.all(/^\/\./, blackHole);
|
||||
// Block access to file types I don't use
|
||||
router.all(/\.php$/, blackHole);
|
||||
router.all(/\.asp$/, blackHole);
|
||||
router.all(/\.aspx$/, blackHole);
|
||||
router.all(/\.gz$/, blackHole);
|
||||
router.all(/\.bz2$/, blackHole);
|
||||
router.all(/\.tar$/, blackHole);
|
||||
router.all(/\.sql$/, blackHole);
|
||||
router.all(/\.env$/, blackHole);
|
||||
router.all(/\.ini$/, blackHole);
|
||||
router.all(/\.pem$/, blackHole);
|
||||
router.all(/\.key$/, blackHole);
|
||||
router.all(/\.crt$/, blackHole);
|
||||
router.all(/\.properties$/, blackHole);
|
||||
// Block access to any .git folders
|
||||
router.all(/\/\.git\//, blackHole);
|
||||
// Block attempts to navigate up directories
|
||||
router.all(/\.\.\//, blackHole);
|
||||
// Block access to special Mac folder
|
||||
router.all(/\/__MACOSX\//, blackHole);
|
||||
// Block access to WordPress files
|
||||
router.all(/^\/?\/?wp-admin(\/.*)?$/, blackHole);
|
||||
router.all(/^\/?\/?wp-includes(\/.*)?$/, blackHole);
|
||||
router.all(/^\/?\/?wp-content(\/.*)?$/, blackHole);
|
||||
router.all(/\/wordpress\//, blackHole);
|
||||
router.all(/\/wp2?\//, blackHole);
|
||||
// Block access to possible databases
|
||||
router.all(/\/database\//, blackHole);
|
||||
router.all(/^\/db(\/.*)?$/, blackHole);
|
||||
router.all(/\/db-backup\//, blackHole);
|
||||
router.all(/\/db_backup\//, blackHole);
|
||||
router.all(/\/sql-backup\//, blackHole);
|
||||
router.all(/^\/sql(\/.*)?$/, blackHole);
|
||||
router.all(/\/pma\//, blackHole);
|
||||
router.all(/\/phpmyadmin\//, blackHole);
|
||||
router.all(/\/mysqladmin\//, blackHole);
|
||||
router.all(/^\/mysql(\/.*)?$/, blackHole);
|
||||
router.all(/\/myadmin\//, blackHole);
|
||||
// Block access to possible backups and uploads
|
||||
router.all(/\/backup(\/.*)?$/, blackHole);
|
||||
router.all(/\/uploads(\/.*)?$/, blackHole);
|
||||
router.all(/\/test(\/.*)?$/, blackHole);
|
||||
router.all(/\/temp(\/.*)?$/, blackHole);
|
||||
router.all(/\/dbbackup\//, blackHole);
|
||||
router.all(/\/bak\//, blackHole);
|
||||
router.all(/archive\.zip$/, blackHole);
|
||||
// Block access to possible credentials
|
||||
router.all(/\/env\.test$/, blackHole);
|
||||
router.all(/^\/?(.*)?\/env$/, blackHole);
|
||||
router.all(/^\/admin(\/.*)?$/, blackHole);
|
||||
router.all(/^\/credentials(\/.*)?$/, blackHole);
|
||||
router.all(/credentials\.json$/, blackHole);
|
||||
router.all(/keys\.json$/, blackHole);
|
||||
router.all(/secrets\.json$/, blackHole);
|
||||
// Block system paths
|
||||
router.all(/\/etc\//, blackHole);
|
||||
router.all(/\/var\//, blackHole);
|
||||
router.all(/\/usr\//, blackHole);
|
||||
router.all(/\/user\//, blackHole);
|
||||
|
||||
module.exports = router
|
||||
// Block misc stuff
|
||||
router.all(/\/data\/owncloud\.log$/, blackHole);
|
||||
router.all(/\/autodiscover\/autodiscover\.xml$/, blackHole);
|
||||
router.all(/\/\.well-known\/autoconfig(\/.*)?$/, blackHole);
|
||||
router.all(/\/sites\/default\/files\//, blackHole);
|
||||
router.all(/\/mail\/config-.+\.xml$/, blackHole);
|
||||
router.all(/\/bitnami\//, blackHole);
|
||||
router.all(/\/aws\//, blackHole);
|
||||
|
||||
// Block methods I don't support
|
||||
router.post("*", blackHole);
|
||||
router.put("*", blackHole);
|
||||
router.delete("*", blackHole);
|
||||
|
||||
module.exports = router;
|
||||
@@ -6,29 +6,28 @@
|
||||
"watch": "nodemon --exec npm start -e \"md,html,scss,js\" -i \"build\""
|
||||
},
|
||||
"dependencies": {
|
||||
"compression": "^1.6.2",
|
||||
"express": "^4.13.4",
|
||||
"handlebars": "^4.0.5",
|
||||
"markdown-it-emoji": "^1.1.1",
|
||||
"metalsmith": "^2.1.0",
|
||||
"metalsmith-build-date": "^0.2.0",
|
||||
"metalsmith-collections": "^0.7.0",
|
||||
"metalsmith-define": "^2.0.1",
|
||||
"metalsmith-feed": "^0.2.0",
|
||||
"metalsmith-in-place": "^1.4.4",
|
||||
"metalsmith-layouts": "^1.6.5",
|
||||
"metalsmith-markdownit": "^0.3.0",
|
||||
"metalsmith-pagination": "^1.4.0",
|
||||
"metalsmith-permalinks": "^0.5.0",
|
||||
"metalsmith-sass": "^1.7.0",
|
||||
"@metalsmith/collections": "^2.0.0",
|
||||
"@metalsmith/in-place": "^5.0.0",
|
||||
"@metalsmith/layouts": "^3.0.0",
|
||||
"@metalsmith/markdown": "^1.10.0",
|
||||
"compression": "^1.8.2",
|
||||
"express": "^4.21.2",
|
||||
"gray-matter": "^4.0.3",
|
||||
"handlebars": "^4.7.10",
|
||||
"jstransformer-handlebars": "^1.2.0",
|
||||
"marked": "^18.2.0",
|
||||
"metalsmith-define": "^2.1.3",
|
||||
"metalsmith-pagination": "^1.5.0",
|
||||
"metalsmith-sitemap": "^1.2.2",
|
||||
"moment": "^2.13.0",
|
||||
"striptags": "^2.1.1"
|
||||
"moment": "^2.31.0",
|
||||
"rss": "^1.2.2",
|
||||
"sass": "^1.108.2",
|
||||
"striptags": "^3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^1.12.1"
|
||||
"nodemon": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "12"
|
||||
"node": "22"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const Handlebars = require("handlebars");
|
||||
const moment = require("moment");
|
||||
const striptags = require("striptags");
|
||||
const { marked } = require("marked");
|
||||
|
||||
// Setup marked renderer
|
||||
marked.setOptions({ gfm: true, breaks: true });
|
||||
const renderer = new marked.Renderer();
|
||||
const originalTable = renderer.table.bind(renderer);
|
||||
renderer.table = function (e) {
|
||||
let result = originalTable(e);
|
||||
return result.replace("<table>", '<table role="grid">');
|
||||
};
|
||||
|
||||
// Register helpers on Handlebars
|
||||
Handlebars.registerHelper("markdown", function (text) {
|
||||
if (!text) return "";
|
||||
return marked.parse(text, { renderer });
|
||||
});
|
||||
Handlebars.registerHelper("moment", function (date, format) {
|
||||
return new moment(date).format(format);
|
||||
});
|
||||
Handlebars.registerHelper("striptags", function (text) {
|
||||
return striptags(text);
|
||||
});
|
||||
Handlebars.registerHelper("buildTitle", function (title, siteTitle) {
|
||||
if (title.indexOf(siteTitle) < 0) {
|
||||
title = "'" + title + "' by " + siteTitle;
|
||||
}
|
||||
return title;
|
||||
});
|
||||
Handlebars.registerHelper("jointags", function (tags) {
|
||||
return (tags || "").split(" ").join(",");
|
||||
});
|
||||
Handlebars.registerHelper("encodetitle", function (str) {
|
||||
return (str || "").replaceAll(" ", "%2B");
|
||||
});
|
||||
|
||||
// Load all partials from templates/partials directory
|
||||
const partialsDir = path.join(__dirname, "..", "templates", "partials");
|
||||
if (fs.existsSync(partialsDir)) {
|
||||
fs.readdirSync(partialsDir).forEach((file) => {
|
||||
const name = path.parse(file).name;
|
||||
const content = fs.readFileSync(path.join(partialsDir, file), "utf8");
|
||||
Handlebars.registerPartial(name, content);
|
||||
});
|
||||
}
|
||||
|
||||
// Compile a template file (used by renderFileAsync)
|
||||
function compile(filePath) {
|
||||
const template = fs.readFileSync(filePath, "utf8");
|
||||
return {
|
||||
fn: Handlebars.compile(template),
|
||||
dependencies: [],
|
||||
};
|
||||
}
|
||||
|
||||
// Render a template string with locals
|
||||
function render(templateStr, opts, locals) {
|
||||
const template = Handlebars.compile(templateStr);
|
||||
const output = template(locals);
|
||||
return { body: output, dependencies: [] };
|
||||
}
|
||||
|
||||
// Render a template file with locals
|
||||
async function renderFileAsync(filePath, opts, locals) {
|
||||
const template = fs.readFileSync(filePath, "utf8");
|
||||
const compiled = Handlebars.compile(template);
|
||||
const output = compiled(locals);
|
||||
return { body: output, dependencies: [] };
|
||||
}
|
||||
|
||||
// Assemble the jstransformer interface
|
||||
const jstransformer = {
|
||||
name: "handlebars",
|
||||
inputFormats: ["hbs", "handlebars", "html"],
|
||||
outputFormat: "html",
|
||||
compile: function (templateStr) {
|
||||
const compiled = Handlebars.compile(templateStr);
|
||||
return { fn: compiled, dependencies: [] };
|
||||
},
|
||||
render: function (templateStr, opts, locals) {
|
||||
return render(templateStr, opts, locals);
|
||||
},
|
||||
renderAsync: async function (templateStr, opts, locals) {
|
||||
return render(templateStr, opts, locals);
|
||||
},
|
||||
renderFileAsync: async function (filePath, opts, locals) {
|
||||
return renderFileAsync(filePath, opts, locals);
|
||||
},
|
||||
registerPartial: Handlebars.registerPartial.bind(Handlebars),
|
||||
registerHelper: Handlebars.registerHelper.bind(Handlebars),
|
||||
partials: Handlebars.partials,
|
||||
helpers: Handlebars.helpers,
|
||||
};
|
||||
|
||||
module.exports = jstransformer;
|
||||
@@ -0,0 +1,184 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
/**
|
||||
* Custom Metalsmith permalinks plugin.
|
||||
* Preserves source directory structure for posts, applies custom patterns for pages.
|
||||
*/
|
||||
function permalinks(options) {
|
||||
const defaultOptions = {
|
||||
pattern: ":date-:title",
|
||||
date: {
|
||||
format: "YYYY-MM-DD",
|
||||
locale: "en",
|
||||
},
|
||||
linksets: [],
|
||||
slug: {
|
||||
lowercase: true,
|
||||
remove: /[<>:"'\|?*]|[^\w\s$_+~.()!\-@\/]+/g,
|
||||
extend: { ":": "-", "|": "-", "/": "-", "<": "", ">": "" },
|
||||
},
|
||||
trailingSlash: false,
|
||||
directoryIndex: "index.html",
|
||||
};
|
||||
|
||||
const opts = { ...defaultOptions, ...options };
|
||||
|
||||
function formatDate(date) {
|
||||
if (!date || !(date instanceof Date)) return "";
|
||||
const d = date;
|
||||
const format = opts.date.format || "YYYY-MM-DD";
|
||||
return format
|
||||
.replace("YYYY", d.getFullYear())
|
||||
.replace("MM", String(d.getMonth() + 1).padStart(2, "0"))
|
||||
.replace("DD", String(d.getDate()).padStart(2, "0"))
|
||||
.replace("D", String(d.getDate()))
|
||||
.replace("H", String(d.getHours()).padStart(2, "0"))
|
||||
.replace("m", String(d.getMinutes()).padStart(2, "0"))
|
||||
.replace("s", String(d.getSeconds()).padStart(2, "0"));
|
||||
}
|
||||
|
||||
function slugify(str) {
|
||||
if (!str) return "";
|
||||
let s = str.toString();
|
||||
if (opts.slug.lowercase) s = s.toLowerCase();
|
||||
if (opts.slug.extend) {
|
||||
for (const [from, to] of Object.entries(opts.slug.extend)) {
|
||||
s = s.split(from).join(to);
|
||||
}
|
||||
}
|
||||
// Replace spaces with dashes and remove special chars
|
||||
s = s.replace(/\s+/g, "-");
|
||||
if (opts.slug.remove) {
|
||||
s = s.replace(new RegExp(opts.slug.remove, "g"), "");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function replacePattern(pattern, data) {
|
||||
return pattern.replace(/:(\w+)(\??)/g, (match, key, optional) => {
|
||||
let value = data[key];
|
||||
if (value === undefined || value === null) {
|
||||
if (optional) return "";
|
||||
throw new Error(
|
||||
`Could not substitute ':${key}' in pattern '${pattern}', '${key}' is undefined`
|
||||
);
|
||||
}
|
||||
// For date in permalink, use _filenameDate if available (to avoid collisions
|
||||
// when front matter date differs from filename date)
|
||||
if (key === 'date' && data._filenameDate) {
|
||||
return formatDate(data._filenameDate);
|
||||
}
|
||||
if (value instanceof Date) {
|
||||
return formatDate(value);
|
||||
}
|
||||
return slugify(value.toString()).replace(/-+/, "-");
|
||||
});
|
||||
}
|
||||
|
||||
function getMatchedLinkset(data, linksets) {
|
||||
for (const linkset of linksets) {
|
||||
if (linkset.match) {
|
||||
let matched = false;
|
||||
for (const [key, val] of Object.entries(linkset.match)) {
|
||||
const fileVal = data[key];
|
||||
if (Array.isArray(fileVal)) {
|
||||
if (fileVal.includes(val)) {
|
||||
matched = true;
|
||||
}
|
||||
} else if (fileVal === val) {
|
||||
matched = true;
|
||||
} else {
|
||||
matched = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (matched) return linkset;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return function (files, metalsmith, done) {
|
||||
const keys = Object.keys(files);
|
||||
|
||||
for (const file of keys) {
|
||||
const data = files[file];
|
||||
|
||||
// Skip non-HTML files
|
||||
if (!file.endsWith(".html")) continue;
|
||||
|
||||
// Skip if permalink is explicitly disabled
|
||||
if (data.permalink === false) continue;
|
||||
|
||||
// Skip if this is a layout/template file (has layout that matches filename)
|
||||
// e.g., index.html with layout: 'index.html' should not be permalinked
|
||||
const baseName = path.basename(file, '.html');
|
||||
if (data.layout === baseName || data.layout === `${baseName}.html`) continue;
|
||||
|
||||
// Determine which linkset to use (or default)
|
||||
const linkset = getMatchedLinkset(data, opts.linksets) || opts;
|
||||
const pattern = linkset.pattern || opts.pattern;
|
||||
|
||||
// Check file-specific permalink first
|
||||
if (data.permalink) {
|
||||
data.permalink = replacePattern(data.permalink, data);
|
||||
if (opts.trailingSlash) data.permalink = data.permalink.replace(/\/+$/, "");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
let sourcePrefix = "";
|
||||
|
||||
// Replace pattern placeholders
|
||||
let result = replacePattern(pattern, data);
|
||||
|
||||
// Remove trailing slashes if not desired
|
||||
if (!opts.trailingSlash) {
|
||||
result = result.replace(/\/+$/, "");
|
||||
}
|
||||
|
||||
// Add directory index
|
||||
if (path.extname(result) === "" || path.extname(result) === ".html") {
|
||||
if (!path.extname(result)) {
|
||||
result = path.join(result, opts.directoryIndex);
|
||||
}
|
||||
}
|
||||
|
||||
data.permalink = result;
|
||||
|
||||
// Set path metadata for templates (permalink without index.html)
|
||||
if (data.permalink.endsWith("/index.html")) {
|
||||
data.path = data.permalink.replace(/\/index\.html$/, "");
|
||||
} else if (path.extname(data.permalink) === ".html") {
|
||||
data.path = data.permalink.replace(/\.html$/, "");
|
||||
} else {
|
||||
data.path = data.permalink;
|
||||
}
|
||||
}
|
||||
|
||||
// Now rename files based on permalink metadata
|
||||
const renames = [];
|
||||
for (const [file, data] of Object.entries(files)) {
|
||||
if (!data.permalink) continue;
|
||||
if (data.permalink === file) continue; // No change needed
|
||||
|
||||
renames.push([file, data.permalink]);
|
||||
}
|
||||
|
||||
for (const [oldName, newName] of renames) {
|
||||
// Create target directory if needed
|
||||
const targetDir = path.dirname(newName);
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
}
|
||||
// Move file
|
||||
files[newName] = files[oldName];
|
||||
delete files[oldName];
|
||||
}
|
||||
|
||||
done();
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = permalinks;
|
||||
@@ -0,0 +1,8 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/2022-07-04-managing-kubernetes-without-loosing-your-cool(/)?', function(req, res) {
|
||||
return res.redirect("/2022-07-04-managing-kubernetes-without-losing-your-cool/")
|
||||
});
|
||||
|
||||
module.exports = router
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig><msapplication><tile><square70x70logo src="/images/favico/ms-icon-70x70.png"/><square150x150logo src="/images/favico/ms-icon-150x150.png"/><square310x310logo src="/images/favico/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
||||
@@ -0,0 +1,101 @@
|
||||
.glitch-image:hover, .glitch:hover, a:hover {
|
||||
animation-iteration-count: infinite;
|
||||
}
|
||||
|
||||
.glitch-image {
|
||||
animation: shift 3s ease-in-out .2s alternate 5;
|
||||
}
|
||||
|
||||
.glitch, a:hover {
|
||||
position: relative;
|
||||
text-shadow: 0.05em 0 0 var(--primary-hover), -0.03em -0.04em 0 var(--primary), 0.025em 0.04em 0 var(--primary-inverse);
|
||||
animation: glitch 2s ease alternate 5, shift 2s ease alternate 5;
|
||||
|
||||
&::before, &::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&::before {
|
||||
animation: glitch 1s infinite;
|
||||
clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
|
||||
transform: translate(-0.04em, -0.03em);
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
&::after {
|
||||
animation: glitch .5s infinite;
|
||||
clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
|
||||
transform: translate(0.04em, 0.03em);
|
||||
opacity: 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes glitch {
|
||||
0% {
|
||||
text-shadow: 0.05em 0 0 var(--primary-hover), -0.03em -0.04em 0 var(--primary),
|
||||
0.025em 0.04em 0 var(--primary-inverse);
|
||||
}
|
||||
15% {
|
||||
text-shadow: 0.05em 0 0 var(--primary-hover), -0.03em -0.04em 0 var(--primary),
|
||||
0.025em 0.04em 0 var(--primary-inverse);
|
||||
}
|
||||
16% {
|
||||
text-shadow: -0.05em -0.025em 0 var(--primary-hover), 0.025em 0.035em 0 var(--primary),
|
||||
-0.05em -0.05em 0 var(--primary-inverse);
|
||||
}
|
||||
49% {
|
||||
text-shadow: -0.05em -0.025em 0 var(--primary-hover), 0.025em 0.035em 0 var(--primary),
|
||||
-0.05em -0.05em 0 var(--primary-inverse);
|
||||
}
|
||||
50% {
|
||||
text-shadow: 0.05em 0.035em 0 var(--primary-hover), 0.03em 0 0 var(--primary),
|
||||
0 -0.04em 0 var(--primary-inverse);
|
||||
}
|
||||
99% {
|
||||
text-shadow: 0.05em 0.035em 0 var(--primary-hover), 0.03em 0 0 var(--primary),
|
||||
0 -0.04em 0 var(--primary-inverse);
|
||||
}
|
||||
100% {
|
||||
text-shadow: -0.05em 0 0 var(--primary-hover), -0.025em -0.04em 0 var(--primary),
|
||||
-0.04em -0.025em 0 var(--primary-inverse);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes shift {
|
||||
0%,40%, 44%, 58%, 61%, 65%,69%,73%,100% {
|
||||
transform: skewX(0deg);
|
||||
filter: invert(0%);
|
||||
fill: var(--text-color);
|
||||
}
|
||||
41% {
|
||||
transform: skewX(50deg);
|
||||
fill: var(--primary);
|
||||
}
|
||||
42% {
|
||||
transform: skewX(-20deg);
|
||||
filter: invert(40%);
|
||||
}
|
||||
59% {
|
||||
transform: skewX(50deg);
|
||||
fill: var(--primary-hover);
|
||||
}
|
||||
60% {
|
||||
transform: skewX(-40deg);
|
||||
filter: invert(10%);
|
||||
}
|
||||
63% {
|
||||
transform: skewX(10deg);
|
||||
filter: invert(30%);
|
||||
fill: var(--primary-hover);
|
||||
}
|
||||
70% {
|
||||
transform: skewX(-30deg);
|
||||
fill: var(--primary);
|
||||
}
|
||||
71% {
|
||||
transform: skewX(15deg);
|
||||
filter: invert(100%);
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
@mixin textShadowToCropUnderline($color) {
|
||||
text-shadow:
|
||||
.01em 0 $color,
|
||||
-.01em 0 $color,
|
||||
0 .01em $color,
|
||||
0 -.01em $color,
|
||||
|
||||
.06em 0 $color,
|
||||
-.06em 0 $color,
|
||||
.09em 0 $color,
|
||||
-.09em 0 $color,
|
||||
|
||||
.12em 0 $color,
|
||||
-.12em 0 $color,
|
||||
.15em 0 $color,
|
||||
-.15em 0 $color;
|
||||
}
|
||||
|
||||
@mixin linkUnderlines($background, $color, $hoverColor) {
|
||||
color: $color;
|
||||
text-decoration: none;
|
||||
@include textShadowToCropUnderline($background);
|
||||
|
||||
background-image:
|
||||
linear-gradient($background, $background),
|
||||
linear-gradient($background, $background),
|
||||
linear-gradient($color, $color);
|
||||
background-size:
|
||||
.05em 2px,
|
||||
.05em 2px,
|
||||
2px 2px;
|
||||
background-repeat:
|
||||
no-repeat,
|
||||
no-repeat,
|
||||
repeat-x;
|
||||
background-position: 0% 1.02em, 100% 1.02em, 0% 1.04em;
|
||||
|
||||
&::selection {
|
||||
@include textShadowToCropUnderline($selectionColor);
|
||||
background-color: $selectionColor;
|
||||
}
|
||||
&::-moz-selection {
|
||||
@include textShadowToCropUnderline($selectionColor);
|
||||
background-color: $selectionColor;
|
||||
}
|
||||
&:before,
|
||||
&:after,
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
text-shadow: none;
|
||||
}
|
||||
&:visited {
|
||||
color: $color;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: $hoverColor;
|
||||
background-image:
|
||||
linear-gradient($background, $background),
|
||||
linear-gradient($background, $background),
|
||||
linear-gradient($hoverColor, $hoverColor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
@@ -1,265 +0,0 @@
|
||||
$link-color: #AD4E4E;
|
||||
$selectionColor: #D2D2D2;
|
||||
$background-color: #FFF;
|
||||
|
||||
@import "_underlines.scss";
|
||||
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: none;
|
||||
}
|
||||
|
||||
* {
|
||||
&::selection {
|
||||
background-color: $selectionColor;
|
||||
}
|
||||
&::-moz-selection {
|
||||
background-color: $selectionColor;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: $link-color;
|
||||
transition: color ease .3s;
|
||||
|
||||
&:hover {
|
||||
color: $link-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&+img {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
header {
|
||||
font-family: 'Lucida Grande', Arial, sans-serif;
|
||||
font-size: .8em;
|
||||
|
||||
a:not(.social) {
|
||||
@include linkUnderlines($background-color, #4a4a4a, $link-color);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
margin: .8em 0 .8em 8px;
|
||||
|
||||
img {
|
||||
height: 1.2em;
|
||||
float: left;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #000 !important;
|
||||
text-decoration: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.social {
|
||||
text-decoration: none;
|
||||
|
||||
svg {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
&:hover svg path,
|
||||
&:hover svg rect {
|
||||
fill: $link-color !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 0 auto;
|
||||
width: 95%;
|
||||
height: 1px;
|
||||
background-color: rgba(0, 0, 0, .2);
|
||||
}
|
||||
}
|
||||
|
||||
pre code {
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 15px;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
p > code {
|
||||
background-color: #3f3f3f;
|
||||
color: #dcdcdc;
|
||||
font-size: 0.9em;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left: 8px solid rgba(121, 130, 139, 0.52);
|
||||
margin-left: 0;
|
||||
padding-left: 1em;
|
||||
color: #79828B;
|
||||
}
|
||||
|
||||
figure {
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
border: 1px solid rgba(100,100,100,.2);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
iframe {
|
||||
max-width: 100%;
|
||||
border: 0;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 0;
|
||||
height: 2px;
|
||||
background: rgba(121, 130, 139, 0.52);
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
details {
|
||||
font-size: 0.8em;
|
||||
border: 1px dashed #79828B;
|
||||
padding: 2px 8px;
|
||||
|
||||
summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.emoji {
|
||||
display: inline !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1020px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.post-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.post-preview {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
text-align: center;
|
||||
}
|
||||
.pagination a {
|
||||
font-size: 1.4mem;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.post {
|
||||
font-family: 'Lucida Grande', Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
line-height: 28px;
|
||||
padding: 2px 8px;
|
||||
|
||||
a {
|
||||
@include linkUnderlines($background-color, #4a4a4a, $link-color);
|
||||
}
|
||||
|
||||
.post-title {
|
||||
color: #000;
|
||||
font-size: 32px;
|
||||
line-height: 34px;
|
||||
margin: 21px 0 0;
|
||||
font-weight: 700;
|
||||
|
||||
a {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.full-post-link {
|
||||
font-style: italic;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
color: #3d4145;
|
||||
font-size: 15px;
|
||||
line-height: 17px;
|
||||
margin: 0 0 12px 0;
|
||||
}
|
||||
}
|
||||
|
||||
footer {
|
||||
margin: 20px 0 10px;
|
||||
color: #79828B;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.social-icons {
|
||||
a {
|
||||
text-decoration: none !important;
|
||||
background: none !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
a svg {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.share {
|
||||
background: transparent;
|
||||
border: none;
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
|
||||
&.show {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
&:hover, &:active {
|
||||
fill: $link-color;
|
||||
color: $link-color;
|
||||
}
|
||||
|
||||
svg {
|
||||
height: 20px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
|
||||
&, tr, td, th, tbody, thead {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 5px;
|
||||
border: 1px solid #3d4145;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@charset "UTF-8";/*!
|
||||
* Pico.css v1.5.3 (https://picocss.com)
|
||||
* Copyright 2019-2022 - Licensed under MIT
|
||||
*/:root{--font-family:system-ui,-apple-system,"Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--line-height:1.5;--font-weight:400;--font-size:16px;--border-radius:0.25rem;--border-width:1px;--outline-width:3px;--spacing:1rem;--typography-spacing-vertical:1.5rem;--block-spacing-vertical:calc(var(--spacing) * 2);--block-spacing-horizontal:var(--spacing);--grid-spacing-vertical:0;--grid-spacing-horizontal:var(--spacing);--form-element-spacing-vertical:0.75rem;--form-element-spacing-horizontal:1rem;--nav-element-spacing-vertical:1rem;--nav-element-spacing-horizontal:0.5rem;--nav-link-spacing-vertical:0.5rem;--nav-link-spacing-horizontal:0.5rem;--form-label-font-weight:var(--font-weight);--transition:0.2s ease-in-out}@media (min-width:576px){:root{--font-size:17px}}@media (min-width:768px){:root{--font-size:18px}}@media (min-width:992px){:root{--font-size:19px}}@media (min-width:1200px){:root{--font-size:20px}}@media (min-width:576px){body>footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 2.5)}}@media (min-width:768px){body>footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 3)}}@media (min-width:992px){body>footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 3.5)}}@media (min-width:1200px){body>footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 4)}}@media (min-width:576px){article{--block-spacing-horizontal:calc(var(--spacing) * 1.25)}}@media (min-width:768px){article{--block-spacing-horizontal:calc(var(--spacing) * 1.5)}}@media (min-width:992px){article{--block-spacing-horizontal:calc(var(--spacing) * 1.75)}}@media (min-width:1200px){article{--block-spacing-horizontal:calc(var(--spacing) * 2)}}dialog>article{--block-spacing-vertical:calc(var(--spacing) * 2);--block-spacing-horizontal:var(--spacing)}@media (min-width:576px){dialog>article{--block-spacing-vertical:calc(var(--spacing) * 2.5);--block-spacing-horizontal:calc(var(--spacing) * 1.25)}}@media (min-width:768px){dialog>article{--block-spacing-vertical:calc(var(--spacing) * 3);--block-spacing-horizontal:calc(var(--spacing) * 1.5)}}a{--text-decoration:none}a.contrast,a.secondary{--text-decoration:underline}small{--font-size:0.875em}h1,h2,h3,h4,h5,h6{--font-weight:700}h1{--font-size:2rem;--typography-spacing-vertical:3rem}h2{--font-size:1.75rem;--typography-spacing-vertical:2.625rem}h3{--font-size:1.5rem;--typography-spacing-vertical:2.25rem}h4{--font-size:1.25rem;--typography-spacing-vertical:1.874rem}h5{--font-size:1.125rem;--typography-spacing-vertical:1.6875rem}[type=checkbox],[type=radio]{--border-width:2px}[type=checkbox][role=switch]{--border-width:3px}tfoot td,tfoot th,thead td,thead th{--border-width:3px}:not(thead):not(tfoot)>*>td{--font-size:0.875em}code,kbd,pre,samp{--font-family:"Menlo","Consolas","Roboto Mono","Ubuntu Monospace","Noto Mono","Oxygen Mono","Liberation Mono",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}kbd{--font-weight:bolder}:root:not([data-theme=dark]),[data-theme=light]{color-scheme:light;--background-color:#fff;--color:hsl(205deg, 20%, 32%);--h1-color:hsl(205deg, 30%, 15%);--h2-color:#24333e;--h3-color:hsl(205deg, 25%, 23%);--h4-color:#374956;--h5-color:hsl(205deg, 20%, 32%);--h6-color:#4d606d;--muted-color:hsl(205deg, 10%, 50%);--muted-border-color:hsl(205deg, 20%, 94%);--primary:hsl(195deg, 85%, 41%);--primary-hover:hsl(195deg, 90%, 32%);--primary-focus:rgba(16, 149, 193, 0.125);--primary-inverse:#fff;--secondary:hsl(205deg, 15%, 41%);--secondary-hover:hsl(205deg, 20%, 32%);--secondary-focus:rgba(89, 107, 120, 0.125);--secondary-inverse:#fff;--contrast:hsl(205deg, 30%, 15%);--contrast-hover:#000;--contrast-focus:rgba(89, 107, 120, 0.125);--contrast-inverse:#fff;--mark-background-color:#fff2ca;--mark-color:#543a26;--ins-color:#388e3c;--del-color:#c62828;--blockquote-border-color:var(--muted-border-color);--blockquote-footer-color:var(--muted-color);--button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--form-element-background-color:transparent;--form-element-border-color:hsl(205deg, 14%, 68%);--form-element-color:var(--color);--form-element-placeholder-color:var(--muted-color);--form-element-active-background-color:transparent;--form-element-active-border-color:var(--primary);--form-element-focus-color:var(--primary-focus);--form-element-disabled-background-color:hsl(205deg, 18%, 86%);--form-element-disabled-border-color:hsl(205deg, 14%, 68%);--form-element-disabled-opacity:0.5;--form-element-invalid-border-color:#c62828;--form-element-invalid-active-border-color:#d32f2f;--form-element-invalid-focus-color:rgba(211, 47, 47, 0.125);--form-element-valid-border-color:#388e3c;--form-element-valid-active-border-color:#43a047;--form-element-valid-focus-color:rgba(67, 160, 71, 0.125);--switch-background-color:hsl(205deg, 16%, 77%);--swiLine truncated
|
||||
/*# sourceMappingURL=pico.min.css.map */
|
||||
@@ -0,0 +1,244 @@
|
||||
/* Light Theme */
|
||||
[data-theme="light"],
|
||||
:root:not([data-theme="dark"]) {
|
||||
--primary: #fd7e0b;
|
||||
--primary-hover: #326ce5;
|
||||
--primary-focus: #fefefe;
|
||||
--primary-inverse: #d6efff;
|
||||
--color: #131b23;
|
||||
--text-color: #131b23;
|
||||
}
|
||||
|
||||
/* Dark Theme */
|
||||
@media only screen and (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--primary: #fd7e0b;
|
||||
--primary-hover: #326ce5;
|
||||
--primary-focus: #131b23;
|
||||
--primary-inverse: #d6efff;
|
||||
--color: #fefefe;
|
||||
--text-color: #fefefe;
|
||||
}
|
||||
}
|
||||
[data-theme="dark"] {
|
||||
--primary: #fd7e0b;
|
||||
--primary-hover: #326ce5;
|
||||
--primary-focus: #131b23;
|
||||
--primary-inverse: #d6efff;
|
||||
--color: #fefefe;
|
||||
--text-color: #fefefe;
|
||||
}
|
||||
|
||||
:root:not([data-theme="dark"]),
|
||||
:root:not([data-theme="light"]){
|
||||
--form-element-active-border-color: var(--primary);
|
||||
--form-element-focus-color: var(--primary-focus);
|
||||
--switch-color: var(--primary-inverse);
|
||||
--switch-checked-background-color: var(--primary);
|
||||
--blockquote-border-color: var(--primary-hover);
|
||||
|
||||
--font-family: 'Orkney', system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu",
|
||||
"Cantarell", "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
||||
"Segoe UI Symbol", "Noto Color Emoji";
|
||||
}
|
||||
|
||||
|
||||
::-moz-selection {
|
||||
background-color: var(--primary);
|
||||
color: var(--primary-inverse);
|
||||
}
|
||||
|
||||
::selection {
|
||||
background-color: var(--primary);
|
||||
color: var(--primary-inverse);
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
// Links
|
||||
|
||||
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
|
||||
color: var(--text-color)
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
@media only screen and (prefers-color-scheme: light) {
|
||||
a.social {
|
||||
svg {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
[data-theme="light"] {
|
||||
a.social {
|
||||
svg {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
a.social {
|
||||
svg {
|
||||
margin: 4px;
|
||||
fill: #fff !important;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
|
||||
svg {
|
||||
animation: shift 1.5s ease-in-out infinite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Layout
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 2em 0 !important;
|
||||
|
||||
& + main {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 1em 0 !important;
|
||||
}
|
||||
|
||||
article {
|
||||
margin-top: 0;
|
||||
padding-top: 1.5em;
|
||||
|
||||
blockquote, dl, figure, form, ol, p, pre, table, ul {
|
||||
font-size: calc(var(--font-size) + 2px) !important;
|
||||
}
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
figure p,
|
||||
blockquote p,
|
||||
blockquote ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
figure a:hover {
|
||||
text-shadow: initial;
|
||||
animation: none;
|
||||
}
|
||||
|
||||
details {
|
||||
font-size: 0.8em;
|
||||
border: 1px dashed #79828B;
|
||||
padding: 2px 8px;
|
||||
|
||||
summary {
|
||||
cursor: pointer;
|
||||
|
||||
&::after {
|
||||
float: unset;
|
||||
display: inline-block;
|
||||
height: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
code, kbd, pre {
|
||||
color: #dcdcdc;
|
||||
background-color: #3f3f3f;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 2em auto;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-top: solid 3px #57688d;
|
||||
text-align: center;
|
||||
width: 60%;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
|
||||
&::after {
|
||||
content: "✨";
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
top: -1em;
|
||||
padding: 0 5px;
|
||||
font-size: 2rem;
|
||||
filter: grayscale(70%);
|
||||
transform: translateX(-50%);
|
||||
|
||||
@media (max-width:768px){
|
||||
top: -1.2em;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&::before {
|
||||
content: ' ';
|
||||
background-color: var(--background-color);
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
top: -1.5em;
|
||||
padding: 0;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 23px;
|
||||
transform: translateX(50%);
|
||||
|
||||
article & {
|
||||
background-color: var(--card-background-color) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.home section:last-of-type hr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Custom Classes
|
||||
|
||||
.site-logo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
font-size: 0.7em;
|
||||
font-family: 'OrkneyLight';
|
||||
vertical-align: text-bottom;
|
||||
margin-bottom: 0.5em;
|
||||
|
||||
&::before {
|
||||
content: "📆 ";
|
||||
filter: grayscale(70%);
|
||||
}
|
||||
}
|
||||
|
||||
.pagination {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
|
||||
@import "_utils.scss";
|
||||
@import "_glitch.scss";
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 179 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 145 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 180 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 307 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="192.000000pt" height="192.000000pt" viewBox="0 0 192.000000 192.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
<metadata>
|
||||
Created by potrace 1.14, written by Peter Selinger 2001-2017
|
||||
</metadata>
|
||||
<g transform="translate(0.000000,192.000000) scale(0.100000,-0.100000)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M1055 1592 c-45 -10 -154 -99 -169 -137 -4 -11 -10 -45 -12 -75 -5
|
||||
-64 -7 -76 -22 -112 -11 -26 -9 -51 8 -118 5 -19 11 -47 14 -63 3 -15 11 -40
|
||||
18 -55 29 -60 4 -115 -57 -125 -11 -2 -35 -11 -52 -20 -18 -10 -33 -15 -33
|
||||
-11 0 4 -6 2 -12 -4 -7 -5 -29 -13 -48 -17 -45 -10 -121 -48 -140 -72 -41 -49
|
||||
-72 -93 -65 -93 4 0 2 -7 -5 -15 -7 -8 -9 -15 -6 -15 4 0 2 -9 -4 -20 -6 -11
|
||||
-13 -38 -15 -60 -2 -22 -9 -58 -15 -80 -6 -23 -13 -58 -16 -78 -2 -20 -7 -50
|
||||
-10 -67 -12 -57 -15 -90 -17 -223 l-2 -132 706 0 706 0 -3 58 c-4 90 -12 149
|
||||
-28 201 -8 27 -12 52 -9 55 3 3 2 13 -2 23 -5 10 -9 24 -11 30 -1 7 -9 32 -17
|
||||
55 -19 54 -41 128 -58 196 -7 28 -17 52 -21 52 -5 0 -7 4 -3 9 3 5 1 12 -5 16
|
||||
-5 3 -17 22 -26 41 -15 30 -89 94 -110 94 -4 0 -26 9 -48 20 -23 11 -50 21
|
||||
-61 23 -11 2 -33 9 -48 15 -16 7 -31 12 -34 12 -16 0 -93 45 -93 54 0 13 52
|
||||
166 73 215 9 21 12 44 7 60 -4 14 -6 64 -4 111 3 101 -8 130 -68 187 -60 57
|
||||
-123 79 -183 65z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.8 MiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 830 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 15 MiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 226 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 403 KiB |