Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs-site/app/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script setup lang="ts">
import type { Collections } from '@nuxt/content'

// Hardcode path to '/' so it is never affected by NUXT_APP_BASE_URL at runtime.
const { data: page } = await useAsyncData('landing', () =>
queryCollection('landing' as keyof Collections).path('/').first(),
queryCollection('landing').path('/').first(),
)

if (!page.value) {
Expand Down
21 changes: 15 additions & 6 deletions docs-site/content.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
import { defineContentConfig, defineCollection } from '@nuxt/content'
import { useNuxt } from '@nuxt/kit'
import { joinURL } from 'ufo'

/**
* Local content configuration for uPKI-RA docs.
*
* We only declare the `landing` collection here (content/index.md).
* The `docs` collection (content/docs/**) is handled by the Docus layer,
* which appends its own content.config.ts definition at a lower priority.
* The `docs` collection (content/docs/**) is handled by the Docus layer.
*
* Declaring `landing` here prevents the Docus layer from attempting to
* register it via useNuxt() at top-level, which can fail silently
* in Docker/CI build environments.
* We use an explicit `cwd` (mirroring the Docus layer pattern) to ensure
* @nuxt/content resolves `index.md` from THIS project's content/ directory
* rather than leaving it ambiguous in the layer stack. Without it, since
* Docus PR #1274 no longer defines the landing collection when index.vue
* exists, the collection ends up empty and the landing page returns 404.
*/
const { options } = useNuxt()
const cwd = joinURL(options.rootDir, 'content')

export default defineContentConfig({
collections: {
landing: defineCollection({
type: 'page',
source: 'index.md',
source: {
cwd,
include: 'index.md',
},
}),
},
})
Loading