chore: change the tag schema mapping for supporting more files.
This commit is contained in:
parent
292e17f632
commit
1e322ec952
@ -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: {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user