diff --git a/.playground/app/app.vue b/.playground/app/app.vue
index fa578f0..39304b7 100644
--- a/.playground/app/app.vue
+++ b/.playground/app/app.vue
@@ -1,7 +1,16 @@
+
+
+
diff --git a/.playground/nuxt.config.ts b/.playground/nuxt.config.ts
index e8d5999..f2943e0 100644
--- a/.playground/nuxt.config.ts
+++ b/.playground/nuxt.config.ts
@@ -7,7 +7,9 @@ export default defineNuxtConfig({
// purge clears cached pages.
routeRules: { '/**': { swr: 300 } },
// The search page is opt-in; the playground turns it on for the smoke.
- journal: { routes: { search: '/search' } },
+ // One post per category page, so the news category has 12 pages and the
+ // smoke sees first, last and gap items.
+ journal: { routes: { search: '/search' }, perPage: { category: 1 } },
i18n: {
strategy: 'prefix_except_default',
defaultLocale: 'en',
diff --git a/app/assets/css/journal-base.css b/app/assets/css/journal-base.css
index 7675430..6c5c0b3 100644
--- a/app/assets/css/journal-base.css
+++ b/app/assets/css/journal-base.css
@@ -290,6 +290,12 @@
color: var(--journal-color-on-accent);
}
+.journal-pagination__gap {
+ display: inline-block;
+ padding: var(--journal-space-1) var(--journal-space-2);
+ color: var(--journal-color-muted);
+}
+
/* Author */
.journal-author-card {
margin-bottom: var(--journal-space-5);
diff --git a/app/components/Journal/CategoryHeader.vue b/app/components/Journal/CategoryHeader.vue
index 9e4b86d..0bf4466 100644
--- a/app/components/Journal/CategoryHeader.vue
+++ b/app/components/Journal/CategoryHeader.vue
@@ -1,6 +1,9 @@
diff --git a/app/components/Journal/Pagination.vue b/app/components/Journal/Pagination.vue
index 04bdc57..e040047 100644
--- a/app/components/Journal/Pagination.vue
+++ b/app/components/Journal/Pagination.vue
@@ -1,33 +1,19 @@
-
+
diff --git a/app/journal-pages/AuthorPage.vue b/app/journal-pages/AuthorPage.vue
index fac8e89..c2a6d1e 100644
--- a/app/journal-pages/AuthorPage.vue
+++ b/app/journal-pages/AuthorPage.vue
@@ -3,9 +3,9 @@
// ?page=N. {author} is the author slug, or a login with published posts. An
// unknown author or an out-of-range page is a real 404. When the visitor came
// in by login, the canonical points at the slug URL (a CMS canonical wins).
-import { pageOutOfRange, parsePageParam } from '../utils/pagination.ts'
+import { pageFromRoute, pageOutOfRange } from '../utils/pagination.ts'
import { absoluteUrl, journalSiteOrigin, listTitle } from '../utils/seo.ts'
-import { toListPost } from '../utils/view.ts'
+import { journalBreadcrumbsOn, toListPost } from '../utils/view.ts'
import type { JournalModuleOptions } from '../utils/types.ts'
definePageMeta({ key: (route) => route.fullPath })
@@ -17,7 +17,7 @@ const { t } = useI18n()
const cfg = useRuntimeConfig().public.journal as JournalModuleOptions
const param = String(route.params.author ?? '')
-const page = parsePageParam(route.query.page)
+const page = pageFromRoute(route)
if (page === null) throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
const { data, error } = await useAsyncData(`journal-author-${param}-${page}`, async () => {
@@ -39,6 +39,7 @@ const author = data.value.author
const name = `${author.first_name} ${author.last_name}`.trim() || author.slug
const title = listTitle(t('journal.author.title', { name }), page, t('journal.pagination.pageTitle', { page }))
useSeoMeta({ title, ogTitle: title, ogType: 'profile' })
+const crumbs = journalBreadcrumbsOn(cfg.breadcrumbs)
if (author.slug !== param) {
const path = links.authorLink(author.slug)
@@ -51,6 +52,7 @@ if (author.slug !== param) {
+
diff --git a/app/journal-pages/CategoryPage.vue b/app/journal-pages/CategoryPage.vue
index d23e979..65be227 100644
--- a/app/journal-pages/CategoryPage.vue
+++ b/app/journal-pages/CategoryPage.vue
@@ -2,11 +2,14 @@
// journal-category: one category's header and rich content above its posts.
// The slug resolves against GET /categories?include_empty=1, so an empty
// category answers 200 with its content; an unknown slug is a real 404 (this
-// route may be a root-level catch-all in the app).
+// route may be a root-level catch-all in the app). The rich content (the
+// pillar text) shows on page 1 only, the short description on every page
+// (D-41); an h1 in it becomes h2 while the category row's content_h1_to_h2
+// is on (absent counts as on), like a post body.
import { sanitizeJournalHtml } from '../utils/htmlGate.ts'
-import { pageOutOfRange, parsePageParam } from '../utils/pagination.ts'
+import { pageFromRoute, pageOutOfRange } from '../utils/pagination.ts'
import { listTitle } from '../utils/seo.ts'
-import { toListPost } from '../utils/view.ts'
+import { journalBreadcrumbsOn, toListPost } from '../utils/view.ts'
import type { JournalModuleOptions } from '../utils/types.ts'
definePageMeta({ key: (route) => route.fullPath })
@@ -17,7 +20,7 @@ const cfg = useRuntimeConfig().public.journal as JournalModuleOptions
const { t } = useI18n()
const slug = String(route.params.category ?? '')
-const page = parsePageParam(route.query.page)
+const page = pageFromRoute(route)
if (page === null) throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
const { data, error } = await useAsyncData(`journal-category-${slug}-${page}`, async () => {
@@ -27,7 +30,7 @@ const { data, error } = await useAsyncData(`journal-category-${slug}-${page}`, a
// Only this category reaches the payload, with its content already sanitized.
const { children: _children, ...category } = found
return {
- category: { ...category, content: sanitizeJournalHtml(found.content) || null },
+ category: { ...category, content: sanitizeJournalHtml(found.content, { demoteH1: found.content_h1_to_h2 !== false }) || null },
posts: { ...posts, data: posts.data.map(toListPost) },
}
})
@@ -42,10 +45,12 @@ if (pageOutOfRange(page, data.value.posts.meta.last_page)) {
const title = listTitle(data.value.category.name, page, t('journal.pagination.pageTitle', { page }))
const description = data.value.category.description ?? undefined
useSeoMeta({ title, ogTitle: title, description, ogDescription: description })
+const crumbs = journalBreadcrumbsOn(cfg.breadcrumbs)
+
diff --git a/app/journal-pages/PostIndexPage.vue b/app/journal-pages/PostIndexPage.vue
index c02a635..d5f2f9a 100644
--- a/app/journal-pages/PostIndexPage.vue
+++ b/app/journal-pages/PostIndexPage.vue
@@ -1,9 +1,9 @@
+
diff --git a/app/journal-pages/PostPage.vue b/app/journal-pages/PostPage.vue
index 3201409..b41aa7a 100644
--- a/app/journal-pages/PostPage.vue
+++ b/app/journal-pages/PostPage.vue
@@ -14,7 +14,7 @@
// excerpt and featured image apply only while there is no CMS answer.
import { cmsHeadPresent, journalPostTitleTag, journalSiteOrigin, postSeoMeta } from '../utils/seo.ts'
import { demotesH1, toPostView } from '../utils/postView.ts'
-import { toListPost } from '../utils/view.ts'
+import { journalBreadcrumbsOn, toListPost } from '../utils/view.ts'
import type { JournalModuleOptions } from '../utils/types.ts'
const route = useRoute()
@@ -64,10 +64,12 @@ useSeoMeta({
const titleTag = computed(() => journalPostTitleTag(cfg.postTitleTag, post.value?.content_h1_to_h2))
const demoteH1 = computed(() => demotesH1(post.value))
+const crumbs = journalBreadcrumbsOn(cfg.breadcrumbs)
+