mirror of
https://github.com/andwati/andwati.com.git
synced 2026-10-18 01:12:53 +00:00
scripts/migrate-posts-to-writings.mjs converts all 20 posts under
content/posts/ into the new writings schema — normalizes dates to
bare TOML local-dates, converts the one unambiguous Zola shortcode in
use (youtube embeds) to a plain <iframe>, and strips the now-meaningless
{% raw %}/{% endraw %} escape tags. content/posts/ itself is untouched;
this only adds content/writings/*.
Also generates 301 redirects from the old /posts/<slug>/ URLs to the
new /writings/<slug>/ ones into sws.toml, inside marker comments so
re-running the script regenerates that block idempotently instead of
duplicating it.
Two posts (from-c-to-machine-code, self-hosting-gitea-and-mirroring-github)
use note/tip/warning/danger callout shortcodes that have no Astro
equivalent yet — flagged by the script rather than guessed at, since
that needs a real component once the design system exists.
Verified: astro check clean, full site builds (80 pages, all real
migrated posts render), redirect generation confirmed idempotent
across repeated runs.
125 lines
3.7 KiB
TOML
125 lines
3.7 KiB
TOML
[advanced]
|
|
|
|
[[advanced.headers]]
|
|
source = "**"
|
|
[advanced.headers.headers]
|
|
Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' https://www.googletagmanager.com https://utteranc.es https://static.cloudflareinsights.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://www.google-analytics.com; font-src 'self'; connect-src 'self' https://www.google-analytics.com https://cloudflareinsights.com; frame-src https://www.youtube-nocookie.com https://utteranc.es; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests"
|
|
X-Frame-Options = "DENY"
|
|
X-Content-Type-Options = "nosniff"
|
|
Referrer-Policy = "strict-origin-when-cross-origin"
|
|
Permissions-Policy = "camera=(), microphone=(), geolocation=(), interest-cohort=()"
|
|
Strict-Transport-Security = "max-age=63072000; includeSubDomains; preload"
|
|
|
|
[[advanced.redirects]]
|
|
source = "/security.txt"
|
|
destination = "/.well-known/security.txt"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/index.xml"
|
|
destination = "/rss.xml"
|
|
kind = 301
|
|
|
|
# BEGIN migrated-posts-redirects (generated by scripts/migrate-posts-to-writings.mjs)
|
|
[[advanced.redirects]]
|
|
source = "/posts/a-fresh-coat-of-paint/"
|
|
destination = "/writings/a-fresh-coat-of-paint/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/file-over-app/"
|
|
destination = "/writings/file-over-app/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/from-c-to-machine-code/"
|
|
destination = "/writings/from-c-to-machine-code/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/generate-django-secret-key/"
|
|
destination = "/writings/generate-django-secret-key/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/hello-world/"
|
|
destination = "/writings/hello-world/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/inertia/"
|
|
destination = "/writings/inertia/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/install-postgresql-15-on-arch-manjaro-garuda-linux/"
|
|
destination = "/writings/install-postgresql-15-on-arch-manjaro-garuda-linux/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/integrating-netlify/"
|
|
destination = "/writings/integrating-netlify/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/javascript-exporting-modules/"
|
|
destination = "/writings/javascript-exporting-modules/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/mmuctf2025/"
|
|
destination = "/writings/mmuctf2025/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/obsidian-sync/"
|
|
destination = "/writings/obsidian-sync/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/scriptctf2025/"
|
|
destination = "/writings/scriptctf2025/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/self-hosting-gitea-and-mirroring-github/"
|
|
destination = "/writings/self-hosting-gitea-and-mirroring-github/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/semantic-version-and-conventional-commits/"
|
|
destination = "/writings/semantic-version-and-conventional-commits/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/subresource-integrity/"
|
|
destination = "/writings/subresource-integrity/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/the-single-byte-that-kills-your-exploit-understanding-endianness/"
|
|
destination = "/writings/the-single-byte-that-kills-your-exploit-understanding-endianness/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/utterances-comments/"
|
|
destination = "/writings/utterances-comments/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/vuejs-tailwind/"
|
|
destination = "/writings/vuejs-tailwind/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/what-is-pwn/"
|
|
destination = "/writings/what-is-pwn/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/wifi-hotspot-arch/"
|
|
destination = "/writings/wifi-hotspot-arch/"
|
|
kind = 301
|
|
|
|
# END migrated-posts-redirects
|