fix: refactor stuff

This commit is contained in:
2026-03-13 16:02:09 +08:00
parent 27bc2fc747
commit 748f57dd55
4 changed files with 7 additions and 11 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
import { Component, createSignal, createEffect, onCleanup, Show, createResource } from 'solid-js';
import { parseMarkdown } from '../markdown';
import { fetchData, extractSection } from '../data-loader';
import { extractSection } from '../data-loader';
import mermaid from 'mermaid';
import {getIndexedData} from "../data-loader/file-index";
export interface ArticleProps {
src: string;
@@ -12,7 +13,7 @@ export interface ArticleProps {
}
async function fetchArticleContent(params: { src: string; section?: string }): Promise<string> {
const text = await fetchData(params.src);
const text = await getIndexedData(params.src);
// 如果指定了 section,提取对应内容
return params.section ? extractSection(text, params.section) : text;
}