mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-05-08 14:24:39 +02:00
#261 - Update tags and categories
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user