diff --git a/next.config.ts b/next.config.ts index 53433574..623e54da 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,8 +2,8 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "export", - // Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html` - // trailingSlash: true, + // Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html` + trailingSlash: true, // Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href` // skipTrailingSlashRedirect: true, // Optional: Change the output directory `out` -> `dist` diff --git a/src/app/blog/[year]/[month]/[day]/[slug]/page.tsx b/src/app/blog/[year]/[month]/[day]/[slug]/page.tsx index 44006126..7b18ca77 100644 --- a/src/app/blog/[year]/[month]/[day]/[slug]/page.tsx +++ b/src/app/blog/[year]/[month]/[day]/[slug]/page.tsx @@ -13,6 +13,7 @@ export async function generateMetadata({ }: { params: Promise<{ year: string; month: string; day: string; slug: string }>; }) { + const { year, month, day, slug } = await params; const { frontmatter } = getPost(await params); const excerpt = frontmatter.excerpt ? frontmatter.excerpt.length > 160 @@ -23,6 +24,7 @@ export async function generateMetadata({ return getPageMetadata({ pageTitle: `${frontmatter.title}`, pageDescription: excerpt, + pagePath: `/blog/${year}/${month}/${day}/${slug}/`, }); } @@ -34,7 +36,7 @@ export default async function BlogPostPage({ const { frontmatter, content } = getPost(await params); return ( - + {frontmatter.title} diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx index f5805e27..dde36583 100644 --- a/src/app/blog/page.tsx +++ b/src/app/blog/page.tsx @@ -2,16 +2,7 @@ import { getAllPosts } from "@/blog-helpers"; import PromMarkdown from "@/components/PromMarkdown"; import TOC from "@/components/TOC"; import { getPageMetadata } from "@/page-metadata"; -import { - Anchor, - Title, - Text, - Card, - Stack, - Button, - Box, - Group, -} from "@mantine/core"; +import { Anchor, Title, Text, Card, Stack, Button, Group } from "@mantine/core"; import dayjs from "dayjs"; import { Metadata } from "next"; import Link from "next/link"; @@ -20,6 +11,7 @@ export const metadata: Metadata = getPageMetadata({ pageTitle: "Blog", pageDescription: "The Prometheus blog contains articles about the project, its components, and the ecosystem.", + pagePath: "/blog/", }); function headingSlug({ year, month, day, slug }) { @@ -52,9 +44,7 @@ export default function BlogPage() { {dayjs(frontmatter.created_at).format("MMMM D, YYYY")} by{" "} {frontmatter.author_name} - - {excerpt} - + {excerpt} - - + + - {nav} + - + {/* The left-hand side main docs nav */} @@ -336,110 +65,20 @@ export default function DocsLayout({ h="calc(100vh - var(--header-height) - var(--header-to-content-margin))" type="never" > - {nav} + + + {/* The main docs page content */} - - {alert} - {children} - - {/* Previous / next sibling page navigation */} - - - - {currentPage.prev && ( - - )} - - - - {currentPage.next && ( - - )} - - - +
{children}
{/* The right-hand-side table of contents for headings within the current document */} - + Governance {content} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 166dac49..e0155612 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,11 +1,10 @@ -"use client"; - // import type { Metadata } from "next"; import { Inter } from "next/font/google"; import { Lato } from "next/font/google"; import { Anchor, AppShell, + AppShellMain, ColorSchemeScript, Container, Group, @@ -24,8 +23,6 @@ import "./globals.css"; import { Header } from "@/components/Header"; import { theme } from "@/theme"; -import "@docsearch/css"; - const interFont = Inter({ variable: "--font-inter", subsets: ["latin"], @@ -58,12 +55,12 @@ export default function RootLayout({
- + {children} - +