Skip to content

[Other]: 给个建议 #477

Description

@ListenV

Issue Description

我看TOC组件很复杂,各种情况的初始化,其实能简化一下

直接在编译期判断URI路径,从而控制组件的显隐,这样能减少代码流入客户端

---
const isPostPage = () => Astro.originPathname.startsWith('/posts')
---

{ isPostPage ? <TOC> : null}

其他的组件也是类似

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions