Skip to content

Commit

Permalink
feat: Add Description from backend
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwinston committed Dec 2, 2024
1 parent e7caaf1 commit 8cd991a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default defineNuxtConfig({
'@nuxtjs/seo',
'@nuxtjs/color-mode',
'nuxt-posthog',
'@nuxtjs/algolia',
],
devtools: { enabled: true },
css: ['~/assets/css/main.scss'],
Expand Down Expand Up @@ -65,7 +66,7 @@ export default defineNuxtConfig({
},
},
navigation: {
fields: ['root', 'tags', 'additional_paths', 'expandable'],
fields: ['root', 'tags', 'additional_paths', 'expandable', 'description'],
},
},
runtimeConfig: {
Expand Down Expand Up @@ -107,6 +108,14 @@ export default defineNuxtConfig({
await buildPages(__dirname);
},
},
algolia: {
apiKey: '76eb519cf1a4492777a6991f75c5252b',
applicationId: 'T5BDNEU205',
// DocSearch key is used to configure DocSearch extension.
docSearch: {
indexName: 'directus',
},
},
eslint: {
config: {
stylistic: {
Expand Down Expand Up @@ -145,7 +154,7 @@ export default defineNuxtConfig({
rateLimiter: false,
headers: {
crossOriginEmbedderPolicy:
process.env.NODE_ENV === 'development' ? 'unsafe-none' : 'require-corp',
process.env.NODE_ENV === 'development' ? 'unsafe-none' : 'require-corp',
},
},
});
2 changes: 2 additions & 0 deletions server/remoteContent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const docPages = async () => {
'id',
'slug',
'title',
'description',
'content',
'sort',
{ tags: [{ tag: ['id', 'icon', 'name'] }] },
Expand Down Expand Up @@ -140,6 +141,7 @@ export const buildPages = async (dir: string) => {
additional_paths: page.additional_paths?.map(path => path.path),
content: undefined,
authors: page.authors?.map(author => author.author),
...(page.description ? { description: page.description } : { description: undefined }),
},
page.content,
);
Expand Down
1 change: 1 addition & 0 deletions types/directus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ interface DocumentationPage {
additional_paths: DocumentationAdditionalPath[]; // Array of Documentation
authors: DocumentationPageAuthor[]; // Array of DocumentationPageAuthor
title: string; // String
description?: string; // String
content: string; // String
sort?: number; // Optional Integer
user_created?: string; // Optional UUID
Expand Down

0 comments on commit 8cd991a

Please sign in to comment.