mirror of
https://github.com/andwati/andwati.com.git
synced 2026-10-18 01:12:53 +00:00
Use the GA4 measurement ID Search Console expects and allow Google Tag Manager/Analytics in the CSP so gtag is not blocked. Add 301s from the old /posts, /writings, /tags, /archive, /about and /index.xml URLs to their current routes to clear the Search Console 404s.
88 lines
2.6 KiB
TOML
88 lines
2.6 KiB
TOML
[general]
|
|
page404 = "./404.html"
|
|
# Next exports /writing as writing.html, so serve it without forcing a trailing slash.
|
|
redirect-trailing-slash = false
|
|
# Serve /.well-known (PGP key, security.txt).
|
|
ignore-hidden-files = false
|
|
|
|
[advanced]
|
|
|
|
# Legacy Hugo URLs (/posts, /writings, /tags, ...) -> current routes. First match wins,
|
|
# so the trailing-slash variants Google crawled come before the bare ones.
|
|
[[advanced.redirects]]
|
|
source = "/posts/page/{*}/"
|
|
destination = "/writing"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/posts/page/{*}"
|
|
destination = "/writing"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/{posts,writings,tags,archive}/"
|
|
destination = "/writing"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/{posts,writings}/{*}/"
|
|
destination = "/writing/$2"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/{posts,writings}/{*}"
|
|
destination = "/writing/$2"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/{posts,writings,tags,archive}"
|
|
destination = "/writing"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/tags/{*}/"
|
|
destination = "/writing"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/tags/{*}"
|
|
destination = "/writing"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/about/"
|
|
destination = "/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/about"
|
|
destination = "/"
|
|
kind = 301
|
|
|
|
[[advanced.redirects]]
|
|
source = "/index.xml"
|
|
destination = "/rss.xml"
|
|
kind = 301
|
|
|
|
[[advanced.headers]]
|
|
source = "**"
|
|
[advanced.headers.headers]
|
|
Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' https://utteranc.es https://analytics.andwati.com https://www.googletagmanager.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://www.google-analytics.com https://www.googletagmanager.com; font-src 'self'; connect-src 'self' https://analytics.andwati.com https://www.google-analytics.com https://*.google-analytics.com https://*.analytics.google.com https://www.googletagmanager.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"
|
|
|
|
# Generated social images are exported without a file extension.
|
|
[[advanced.headers]]
|
|
source = "**/opengraph-image"
|
|
[advanced.headers.headers]
|
|
Content-Type = "image/png"
|
|
|
|
# Hashed build assets never change.
|
|
[[advanced.headers]]
|
|
source = "/_next/static/**"
|
|
[advanced.headers.headers]
|
|
Cache-Control = "public, max-age=31536000, immutable"
|