diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml index a479bdd..bf1b72a 100644 --- a/.github/workflows/sync-fork.yml +++ b/.github/workflows/sync-fork.yml @@ -30,6 +30,9 @@ jobs: # otherwise Vercel skips the deployment. git config user.name "m-junaidd" git config user.email "176620033+m-junaidd@users.noreply.github.com" + # Refresh the sitemap's page dates from the full history. Never + # allowed to stop a deploy: on any failure the committed file is used. + node scripts/page-dates.mjs && git add lib/page-dates.json || echo "Page dates not refreshed" git commit --amend --no-edit --reset-author git remote add fork https://x-access-token:${{ secrets.FORK_SYNC_TOKEN }}@github.com/m-junaidd/web-platform.git git push fork HEAD:main --force diff --git a/app/.well-known/security.txt/route.ts b/app/.well-known/security.txt/route.ts new file mode 100644 index 0000000..0175d53 --- /dev/null +++ b/app/.well-known/security.txt/route.ts @@ -0,0 +1,23 @@ +import { SITE_URL } from '@/lib/seo' + +// Built with the site, so the expiry date moves forward with every deploy +export const dynamic = 'force-static' + +/** + * Where to report a security problem (RFC 9116). The address is the one + * SECURITY.md in the repository already gives. The file must carry an expiry + * date less than a year away. + */ +export function GET() { + const expires = new Date(Date.now() + 364 * 24 * 60 * 60 * 1000) + expires.setUTCHours(0, 0, 0, 0) + + const body = `Contact: mailto:info@devweekends.com +Expires: ${expires.toISOString()} +Preferred-Languages: en +Canonical: ${SITE_URL}/.well-known/security.txt +Policy: https://github.com/devweekends/web-platform/blob/main/SECURITY.md +` + + return new Response(body, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) +} diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx index d4b4fce..dde62cc 100644 --- a/app/blog/[slug]/page.tsx +++ b/app/blog/[slug]/page.tsx @@ -7,11 +7,15 @@ import Link from "next/link"; import { ArticleBody } from "@/components/content/article-body"; import { formatDate } from "@/components/content/format-date"; import { Button, Eyebrow, container } from "@/components/site/page-kit"; -import { SITE_NAME, blogPostingJsonLd, excerptOf, jsonLdString, pageTitle, snippetOf, withSocial } from "@/lib/seo"; +import { SITE_NAME, blogPostingJsonLd, breadcrumbJsonLd, excerptOf, jsonLdString, pageTitle, snippetOf, withSocial } from "@/lib/seo"; const backLink = "inline-flex min-h-11 items-center text-[15px] font-medium text-[#5C5C5C] transition-colors hover:text-[#0A0A0A]"; +// Only the posts that exist. Any other address is a real 404, not a page that +// says "not found" with a 200. +export const dynamicParams = false; + export function generateStaticParams() { const dir = path.join(process.cwd(), "content", "blog"); if (!fs.existsSync(dir)) return []; @@ -102,6 +106,12 @@ export default async function BlogPost({ return (