mirror of
https://github.com/quartz-community/tag-page.git
synced 2026-07-22 02:50:25 +00:00
fix: remove PageData interface causing DTS build failures
This commit is contained in:
parent
0686df0d55
commit
b707032d04
1 changed files with 3 additions and 19 deletions
|
|
@ -1,24 +1,8 @@
|
|||
import type {
|
||||
QuartzComponent,
|
||||
QuartzComponentProps,
|
||||
QuartzPluginData,
|
||||
SortFn,
|
||||
} from "@quartz-community/types";
|
||||
import type { QuartzComponent, QuartzComponentProps, SortFn } from "@quartz-community/types";
|
||||
import { getDate, byDateAndAlphabetical } from "@quartz-community/utils/sort";
|
||||
import { resolveRelative, isFolderPath } from "../util/path";
|
||||
import type { FullSlug } from "../util/path";
|
||||
|
||||
interface PageData extends QuartzPluginData {
|
||||
slug?: string;
|
||||
frontmatter?: { title?: string; tags?: string[] };
|
||||
dates?: {
|
||||
created: Date;
|
||||
modified: Date;
|
||||
published: Date;
|
||||
};
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export type { SortFn } from "@quartz-community/types";
|
||||
export { byDateAndAlphabetical };
|
||||
|
||||
|
|
@ -72,7 +56,7 @@ export const PageList: QuartzComponent = ({
|
|||
sort,
|
||||
}: PageListProps) => {
|
||||
const sorter = sort ?? byDateAndAlphabeticalFolderFirst(cfg);
|
||||
let list = [...(allFiles as PageData[])].sort(sorter);
|
||||
let list = [...allFiles].sort(sorter);
|
||||
if (limit) {
|
||||
list = list.slice(0, limit);
|
||||
}
|
||||
|
|
@ -83,7 +67,7 @@ export const PageList: QuartzComponent = ({
|
|||
<ul class="section-ul">
|
||||
{list.map((page) => {
|
||||
const title = page.frontmatter?.title;
|
||||
const tags = page.frontmatter?.tags ?? [];
|
||||
const tags = (page.frontmatter?.tags ?? []) as string[];
|
||||
|
||||
return (
|
||||
<li class="section-li">
|
||||
|
|
|
|||
Loading…
Reference in a new issue