Skip to content

Commit 7a2ebba

Browse files
committed
docs: add og image for landing page
1 parent 97463ce commit 7a2ebba

File tree

6 files changed

+449
-32
lines changed

6 files changed

+449
-32
lines changed

docs/app/pages/index.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<script setup lang="ts">
2-
useSeoMeta({
3-
title: 'Nuxt Content made easy for Vue Developers',
4-
description: 'Nuxt Content reads the content/ directory in your project, parses .md, .yml, .csv and .json files to create a powerful data layer for your application. Use Vue components in Markdown with the MDC syntax.',
5-
})
2+
const siteConfig = useSiteConfig()
3+
64
const { data: page } = await useAsyncData('index', () => queryCollection('content').first())
75
if (!page.value) {
86
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
97
}
8+
9+
useSeoMeta({
10+
title: page.value.title,
11+
description: page.value.description,
12+
ogTitle: page.value.title,
13+
ogDescription: page.value.description,
14+
ogImage: `${siteConfig.url}/social.png`,
15+
twitterImage: `${siteConfig.url}/social.png`,
16+
})
1017
</script>
1118

1219
<template>

docs/content.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const collections = {
2121
}),
2222
}),
2323
content: defineCollection({
24-
type: 'data',
25-
source: '*.yml',
24+
type: 'page',
25+
source: 'index.yml',
2626
schema: z.object({
2727
hero: z.object({
2828
title: z.string(),

docs/content/index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
title: The git-based CMS for Nuxt projects.
2+
description: Nuxt Content is a module for Nuxt that provides a simple way to manage content for your application. It allows developers to write their content in Markdown, YAML, or JSON files and then query and display it in their application.
13
hero:
24
title: The git-based CMS for<br> Nuxt projects.
35
description: Nuxt Content is a module for Nuxt that provides a simple way to manage content for your application. It allows developers to write their content in Markdown, YAML, or JSON files and then query and display it in their application.

docs/public/social.png

117 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"micromatch": "^4.0.8",
6464
"ohash": "^1.1.4",
6565
"pathe": "^1.1.2",
66-
"remark-mdc": "^3.2.1",
66+
"remark-mdc": "latest",
6767
"scule": "^1.3.0",
6868
"shiki": "^1.22.2",
6969
"slugify": "^1.6.6",

0 commit comments

Comments
 (0)