From 641df3471a799aead6a2e23a78d84ce3376bf91c Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Fri, 4 Dec 2026 20:29:07 +1300 Subject: [PATCH] Blog: only posts put the title on its own row, with twice the gap above the date; /blog/ and the docs keep the buttons on the title row --- frontend/src/pages/DocsPage.tsx | 34 ++++++++++++++++++++++----------- frontend/src/styles.css | 25 +++++++++++++++++++++--- scripts/screenshots/pages.mjs | 4 +++- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/frontend/src/pages/DocsPage.tsx b/frontend/src/pages/DocsPage.tsx index c60d7f80..f41c9c9e 100644 --- a/frontend/src/pages/DocsPage.tsx +++ b/frontend/src/pages/DocsPage.tsx @@ -67,6 +67,14 @@ function CopyPage({ href }: { href: string }) { export function DocsPage({ page }: { page: DocsPageData }) { const current = page.nav.flatMap((s) => s.pages).find((p) => p.slug === page.slug) const markdown = page.markdown ?? docsMarkdownPath(page.slug) + const actions = ( +
+ + View as Markdown + + +
+ ) const standalone = page.nav.length === 0 return (
@@ -110,18 +118,22 @@ export function DocsPage({ page }: { page: DocsPageData }) { )}
-
-

{page.title}

-
- {page.meta &&

} -

- - View as Markdown - - + {/* A blog post has its title on a row of its own, then its date and author beside the buttons. Every other + page has the buttons on the title row. */} + {page.meta ? ( +
+

{page.title}

+
+

+ {actions}

-
-
+ + ) : ( +
+

{page.title}

+ {actions} +
+ )}
diff --git a/frontend/src/styles.css b/frontend/src/styles.css index 1e3e611b..498b86a6 100644 --- a/frontend/src/styles.css +++ b/frontend/src/styles.css @@ -4251,11 +4251,27 @@ svg.regions-dim { Copy page on the right. On a phone the buttons wrap below the date and author. */ .docs-head { display: flex; - flex-direction: column; - gap: var(--space-3); + align-items: center; + justify-content: space-between; + gap: var(--space-4); margin-bottom: var(--space-8); } +@media (max-width: 640px) { + .docs-head { + flex-direction: column; + align-items: flex-start; + } +} + +/* A blog post: the title on its own row, then the date and author with the buttons on the right. */ +.docs-head-post { + flex-direction: column; + align-items: stretch; + justify-content: flex-start; + gap: var(--space-6); +} + .docs-head-row { display: flex; flex-wrap: wrap; @@ -4272,11 +4288,14 @@ svg.regions-dim { display: flex; flex: none; gap: var(--space-2); +} + +.docs-head-row .docs-actions { margin-left: auto; } @media (max-width: 640px) { - .docs-actions { + .docs-head-row .docs-actions { margin-left: 0; } } diff --git a/scripts/screenshots/pages.mjs b/scripts/screenshots/pages.mjs index af13c2b3..c6eca8b8 100644 --- a/scripts/screenshots/pages.mjs +++ b/scripts/screenshots/pages.mjs @@ -26,7 +26,9 @@ export function pages() { return bothThemes([ ['landing', '/', false, ALL], ['docs/index', '/docs/', false, ALL], - // The blog's list (newest first: the order Nathan checks) and a post, whose header the docs pages share. + ['docs/page', '/docs/quick-start/', false, ALL], + // The blog's list (newest first: the order Nathan checks) and a post. Only a post has its title on a row of its + // own; the list and the docs keep the buttons on the title row. ['blog/index', '/blog/', false, ALL], ['blog/post', '/blog/weasyprint-case-study/', false, ALL], ['app/orgs', '/', true, ALL],