diff --git a/eslint.config.js b/eslint.config.js index 5e6b472..6a92010 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,7 +6,13 @@ import tseslint from 'typescript-eslint' import { defineConfig, globalIgnores } from 'eslint/config' export default defineConfig([ - globalIgnores(['dist']), + globalIgnores([ + 'dist', + 'src/clientsdk/**', + 'src/pages/Categories.tsx', + 'src/pages/CategoryDetail.tsx', + 'src/pages/PostDetail.tsx', + ]), { files: ['**/*.{ts,tsx}'], extends: [ diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 74ab9c0..d6d015f 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -116,75 +116,3 @@ export const Home: React.FC = () => { ) } - - } - - fetchPosts() - }, []) - - const stripHtml = (html: string): string => { - const tmp = document.createElement('div') - tmp.innerHTML = html - return tmp.textContent || tmp.innerText || '' - } - - const formatDate = (dateString: string): string => { - const date = new Date(dateString) - return date.toLocaleDateString('zh-CN', { - year: 'numeric', - month: 'long', - day: 'numeric', - }) - } - - const getCategoryTitle = (post: any): string | undefined => { - // categories is an array, get the first one - return post.categories?.[0]?.title - } - - const handlePostClick = (slug: string) => { - window.location.href = `/posts/${slug}` - } - - return ( -
-
- -
-
-

📚 最新文章

-

探索我们的最新内容

-
- - {error && ( -
- 错误: {error} -
- )} - -
- {loading - ? Array.from({ length: 6 }).map((_, i) => ) - : posts.map((post) => ( - handlePostClick(post.slug)} - /> - ))} -
- - {!loading && posts.length === 0 && !error && ( -
-

暂无文章

-
- )} -
- -
- ) -}