mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-26 22:34:06 -06:00
chore: update type error
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
parent
235b7ab72c
commit
e47a7c187f
@ -1,8 +1,9 @@
|
|||||||
|
import { ComponentChildren } from "preact"
|
||||||
import { htmlToJsx } from "../../util/jsx"
|
import { htmlToJsx } from "../../util/jsx"
|
||||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
|
||||||
|
|
||||||
const Content: QuartzComponent = ({ fileData, tree }: QuartzComponentProps) => {
|
const Content: QuartzComponent = ({ fileData, tree }: QuartzComponentProps) => {
|
||||||
const content = htmlToJsx(fileData.filePath!, tree)
|
const content = htmlToJsx(fileData.filePath!, tree) as ComponentChildren
|
||||||
const classes: string[] = fileData.frontmatter?.cssclasses ?? []
|
const classes: string[] = fileData.frontmatter?.cssclasses ?? []
|
||||||
const classString = ["popover-hint", ...classes].join(" ")
|
const classString = ["popover-hint", ...classes].join(" ")
|
||||||
return <article class={classString}>{content}</article>
|
return <article class={classString}>{content}</article>
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { Root } from "hast"
|
|||||||
import { htmlToJsx } from "../../util/jsx"
|
import { htmlToJsx } from "../../util/jsx"
|
||||||
import { i18n } from "../../i18n"
|
import { i18n } from "../../i18n"
|
||||||
import { QuartzPluginData } from "../../plugins/vfile"
|
import { QuartzPluginData } from "../../plugins/vfile"
|
||||||
|
import { ComponentChildren } from "preact"
|
||||||
|
|
||||||
interface FolderContentOptions {
|
interface FolderContentOptions {
|
||||||
/**
|
/**
|
||||||
@ -78,10 +79,11 @@ export default ((opts?: Partial<FolderContentOptions>) => {
|
|||||||
allFiles: allPagesInFolder,
|
allFiles: allPagesInFolder,
|
||||||
}
|
}
|
||||||
|
|
||||||
const content =
|
const content = (
|
||||||
(tree as Root).children.length === 0
|
(tree as Root).children.length === 0
|
||||||
? fileData.description
|
? fileData.description
|
||||||
: htmlToJsx(fileData.filePath!, tree)
|
: htmlToJsx(fileData.filePath!, tree)
|
||||||
|
) as ComponentChildren
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="popover-hint">
|
<div class="popover-hint">
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { QuartzPluginData } from "../../plugins/vfile"
|
|||||||
import { Root } from "hast"
|
import { Root } from "hast"
|
||||||
import { htmlToJsx } from "../../util/jsx"
|
import { htmlToJsx } from "../../util/jsx"
|
||||||
import { i18n } from "../../i18n"
|
import { i18n } from "../../i18n"
|
||||||
|
import { ComponentChildren } from "preact"
|
||||||
|
|
||||||
interface TagContentOptions {
|
interface TagContentOptions {
|
||||||
sort?: SortFn
|
sort?: SortFn
|
||||||
@ -33,10 +34,11 @@ export default ((opts?: Partial<TagContentOptions>) => {
|
|||||||
(file.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes).includes(tag),
|
(file.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes).includes(tag),
|
||||||
)
|
)
|
||||||
|
|
||||||
const content =
|
const content = (
|
||||||
(tree as Root).children.length === 0
|
(tree as Root).children.length === 0
|
||||||
? fileData.description
|
? fileData.description
|
||||||
: htmlToJsx(fileData.filePath!, tree)
|
: htmlToJsx(fileData.filePath!, tree)
|
||||||
|
) as ComponentChildren
|
||||||
const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? []
|
const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? []
|
||||||
const classes = cssClasses.join(" ")
|
const classes = cssClasses.join(" ")
|
||||||
if (tag === "/") {
|
if (tag === "/") {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user