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`.
|
If you don't want the astro integration, change the switch in `options.ts` to `false`.
|
||||||
|
|
||||||
```json
|
```typescript
|
||||||
{
|
{
|
||||||
settings: {
|
settings: {
|
||||||
comments: {
|
comments: {
|
||||||
|
@ -61,11 +61,13 @@ export const categories: Category[] = categoriesCollection.map((cat) => ({
|
|||||||
permalink: `/cats/${cat.data.slug}`,
|
permalink: `/cats/${cat.data.slug}`,
|
||||||
...cat.data,
|
...cat.data,
|
||||||
}));
|
}));
|
||||||
export const tags: Tag[] = tagsCollection[0].data.map((tag) => ({
|
export const tags: Tag[] = tagsCollection.flatMap((tags) => {
|
||||||
counts: posts.filter((post) => post.tags.includes(tag.name)).length,
|
return tags.data.map((tag) => ({
|
||||||
permalink: `/tags/${tag.slug}`,
|
counts: posts.filter((post) => post.tags.includes(tag.name)).length,
|
||||||
...tag,
|
permalink: `/tags/${tag.slug}`,
|
||||||
}));
|
...tag,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
// Find the missing categories from posts.
|
// Find the missing categories from posts.
|
||||||
const missingCategories: string[] = posts
|
const missingCategories: string[] = posts
|
||||||
|
Loading…
Reference in New Issue
Block a user