Skip to content

Commit

Permalink
feat: seo
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <zhangtianli2006@163.com>
  • Loading branch information
ZTL-UwU committed May 25, 2024
1 parent 115bf3d commit ee9d213
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export default defineAppConfig({
shadcnDocs: {
site: {
name: 'shadcn-docs',
},
header: {
title: 'shadcn-docs',
showTitle: true,
Expand Down
2 changes: 1 addition & 1 deletion components/layout/SearchDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</NuxtLink>
</div>

<div v-if="!searchResult?.length && input?.length" class="text-center text-muted-foreground p-2">
<div v-if="!searchResult?.length && input?.length" class="text-center text-muted-foreground pt-4">
No results found.
</div>

Expand Down
8 changes: 7 additions & 1 deletion pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</aside>
<main class="relative py-6" :class="[config.toc.enable && 'lg:gap-10 lg:py-8 lg:grid lg:grid-cols-[1fr_200px]']">
<div class="mx-auto w-full min-w-0">
<LayoutBreadcrumb v-if="config.main.breadCrumb" class="mb-4" />
<LayoutBreadcrumb v-if="page?.body && config.main.breadCrumb" class="mb-4" />

<div v-if="config.main.showTitle" class="space-y-2 mb-6">
<ProseH1>
Expand Down Expand Up @@ -49,4 +49,10 @@
<script setup lang="ts">
const { page } = useContent();
const config = useConfig();
useSeoMeta({
title: `${page.value?.title ?? '404'} - ${config.value.site.name}`,
ogTitle: page.value?.title,
description: page.value?.description,
});
</script>

0 comments on commit ee9d213

Please sign in to comment.