#261 - Update tags and categories

This commit is contained in:
Elio Struyf
2022-02-19 17:32:32 +01:00
parent eabdf00d3d
commit 65f77baf2b
7 changed files with 78 additions and 8 deletions
+2 -2
View File
@@ -100,12 +100,12 @@ export default function usePages(pages: Page[]) {
// Filter by tag
if (tag) {
pagesSorted = pagesSorted.filter(page => page.tags && page.tags.includes(tag));
pagesSorted = pagesSorted.filter(page => page.fmTags && page.fmTags.includes(tag));
}
// Filter by category
if (category) {
pagesSorted = pagesSorted.filter(page => page.categories && page.categories.includes(category));
pagesSorted = pagesSorted.filter(page => page.fmCategories && page.fmCategories.includes(category));
}
setPageItems(pagesSorted);
+3
View File
@@ -7,6 +7,9 @@ export interface Page {
fmModified: number;
fmDraft: "Draft" | "Published",
fmYear: number | null | undefined;
fmPreviewImage: string;
fmTags: string[];
fmCategories: string[];
title: string;
slug: string;