How chen017/blog works
This repository is a CMS-integrated Astro static blog template. Its user-facing flow is configured Markdown/MDX content rendered with blog-specific directives and media handling, then presented through navigation, search, sidebar widgets, and music controls; it also generates feeds and social preview images. The README highlights music cards, media lazy loading, and customized link/skill cards. Some page and utility implementations were not sampled, so their internal call relationships are omitted; configuration explicitly wires the Markdown plugins.
Main entry points: astro.config.mjs Astro Markdown pipeline · widget.ts Sidebar widgets · config.ts Blog configuration · content.ts Content utilities
Components 27
Content rendering
- Astro Markdown pipeline
astro.config.mjs - Directive conversion
src/plugins/remark-directive-rehype.js - Admonition cards
src/plugins/rehype-component-admonition.mjs - GitHub cards
src/plugins/rehype-component-github-card.mjs - Music cards
src/plugins/rehype-component-music-card.mjs - Song cards
src/plugins/rehype-component-song-card.mjs - Lazy media
src/plugins/rehype-lazy-load-media.mjs - Mermaid diagrams
src/plugins/rehype-mermaid.mjs - Code block controls
src/plugins/expressive-code/copy-button.ts
Blog experience
- Blog reader
- Post search
src/components/navbar/search.svelte - Search panel
src/components/common/DropdownPanel.svelte - Music player
src/components/musicPlayer.svelte - Sidebar widgets
src/utils/widget.ts - Directory tree
src/components/sidebar/directoryTree.svelte - Blog statistics
src/components/sidebar/statistics.svelte - Table of contents
src/components/sidebar/toc.ts - Link presets
src/constants/link-presets.ts
Site configuration
- Blog configuration
src/config.ts - Configuration types
src/types/config.ts - Wallpaper behavior
src/utils/wallpaper.ts - Widget behavior
src/utils/widget.ts
Feeds and previews
- Content utilities
src/utils/content.ts - Atom feed
src/pages/atom.xml.ts - RSS feed
src/pages/rss.xml.ts - Social preview image
src/pages/og/[...slug].png.ts
Other components
- Content author
Connections 23
- Content author → Astro Markdown pipeline: provides content
- Astro Markdown pipeline → Directive conversion: registers plugin
astro.config.mjs - Astro Markdown pipeline → Admonition cards: registers component
astro.config.mjs - Astro Markdown pipeline → GitHub cards: registers component
astro.config.mjs - Astro Markdown pipeline → Music cards: registers component
astro.config.mjs - Astro Markdown pipeline → Song cards: registers component
astro.config.mjs - Astro Markdown pipeline → Lazy media: registers plugin
astro.config.mjs - Astro Markdown pipeline → Mermaid diagrams: registers plugin
astro.config.mjs - Astro Markdown pipeline → Code block controls: registers plugin
astro.config.mjs - Blog reader → Post search: searches posts
- Post search → Search panel: uses panel
src/components/navbar/search.svelte - Blog reader → Music player: controls playback
- Blog reader → Sidebar widgets: views sidebar
- Sidebar widgets → Directory tree: selects component
- Sidebar widgets → Blog statistics: selects component
- Sidebar widgets → Table of contents: selects component
- Blog reader → Link presets: uses navigation
- Blog configuration → Configuration types: uses types
src/config.ts - Blog configuration → Wallpaper behavior: configures behavior
src/utils/wallpaper.ts - Blog configuration → Widget behavior: configures behavior
src/utils/widget.ts - Atom feed → Content utilities: loads posts
src/pages/atom.xml.ts - RSS feed → Content utilities: loads posts
src/pages/rss.xml.ts - Social preview image → Content utilities: loads posts