diff --git a/README.md b/README.md index e34c590..f16b1ec 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ database. If you don't want the astro integration, change the switch in `options.ts` to `false`. -```json +```typescript { settings: { comments: { diff --git a/src/helpers/schema.ts b/src/helpers/schema.ts index 5164601..45ff1ee 100644 --- a/src/helpers/schema.ts +++ b/src/helpers/schema.ts @@ -61,11 +61,13 @@ export const categories: Category[] = categoriesCollection.map((cat) => ({ permalink: `/cats/${cat.data.slug}`, ...cat.data, })); -export const tags: Tag[] = tagsCollection[0].data.map((tag) => ({ - counts: posts.filter((post) => post.tags.includes(tag.name)).length, - permalink: `/tags/${tag.slug}`, - ...tag, -})); +export const tags: Tag[] = tagsCollection.flatMap((tags) => { + return tags.data.map((tag) => ({ + counts: posts.filter((post) => post.tags.includes(tag.name)).length, + permalink: `/tags/${tag.slug}`, + ...tag, + })); +}); // Find the missing categories from posts. const missingCategories: string[] = posts