mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 23:56:51 +00:00
Add feature order cycle guide
This commit is contained in:
@@ -30,11 +30,17 @@ export function Guide({ id }: Props) {
|
||||
const { version, changeVersion } = useVersion()
|
||||
const { changeTitle } = useTitle()
|
||||
|
||||
const { value: content } = useAsync(async () => {
|
||||
const { value: content, refresh } = useAsync(async () => {
|
||||
const res = await fetch(`../../guides/${id}.md`)
|
||||
return await res.text()
|
||||
}, [id])
|
||||
|
||||
if ((import.meta as any).hot) {
|
||||
(import.meta as any).hot.on('guide-update', (updateId: string) => {
|
||||
if (id === updateId) refresh()
|
||||
})
|
||||
}
|
||||
|
||||
const frontMatter = useMemo(() => {
|
||||
if (!content) return undefined
|
||||
const data = parseFrontMatter(content)
|
||||
|
||||
Reference in New Issue
Block a user