File tree Expand file tree Collapse file tree 5 files changed +38
-6
lines changed
Expand file tree Collapse file tree 5 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import LicenceBox from "@/components/licences/LicenceBox.astro";
55import type { IconName } from " @/scripts/icons" ;
66import Icon from " @/components/Icon.astro" ;
77import { getEntry } from " astro:content" ;
8+ import { getCatsInfo , getTagsInfo } from " @/scripts/tags" ;
89export interface Props {
910 layoutProps: {
1011 url? : string ;
@@ -98,7 +99,7 @@ import { getCatSlug } from "@/scripts/tags";
9899 分类:
99100 { cats .map ((cat ) => (
100101 <a class = " cat" href = { ` /categories/${getCatSlug (cat )}/ ` } >
101- { cat }
102+ { cat } < sup > { getCatsInfo (). get ( cat ) } </ sup >
102103 </a >
103104 ))}
104105 </div >
@@ -112,7 +113,7 @@ import { getCatSlug } from "@/scripts/tags";
112113 标签:
113114 { tags .map ((tag ) => (
114115 <a class = " tag" href = { ` /tags/${tag }/ ` } >
115- { tag }
116+ { tag } < sup > { getTagsInfo (). get ( tag ) } </ sup >
116117 </a >
117118 ))}
118119 </div >
Original file line number Diff line number Diff line change 1+ # import " /src/docs/html-template.typ" : *
2+ # template [
3+ = 第 2 章
4+ # include " /node_modules/buaa-digital-image-processing/chap02/main.typ"
5+
6+ = 第 3 章
7+ # include " /node_modules/buaa-digital-image-processing/chap03/main.typ"
8+
9+ = 第 4 章
10+ // #include "/node_modules/buaa-digital-image-processing/chap04/main.typ"
11+
12+ = 第 10 章
13+ // #include "/node_modules/buaa-digital-image-processing/chap10/main.typ"
14+ ]
Original file line number Diff line number Diff line change 1+ ---
2+ title : 数字图像处理
3+ date : 2025-06-26T20:16:23.340Z
4+ noscript : true
5+ licence : false
6+ layout : " @/layouts/Default.astro"
7+ tags : []
8+ categories :
9+ - Typst
10+ draft : true
11+ ---
12+
13+ import Content from " ./_dip.typ"
14+
15+ <Content />
Original file line number Diff line number Diff line change 1111 - Astro
1212 - meme
1313categories :
14- - typst
14+ - Typst
1515---
1616
1717众所周知,[ Typst Universe] ( https://typst.app/universe/ ) 是 typst 生态中的三方包 registry。在 2025 年的年中,向大家介绍新一代的 typst 包管理和三方包仓库:NPM Universe。顾名思义,就是使用一个名叫「npm」的命令行工具的 Typst Universe 替代品。
Original file line number Diff line number Diff line change 11import { getBlogPosts } from "@/scripts/post" ;
22const posts = await getBlogPosts ( ) ;
33
4- export async function getTagsInfo ( ) {
5- const tagsInfo = new Map < string , number > ( ) ;
4+ const tagsInfo = new Map < string , number > ( ) ;
5+ export function getTagsInfo ( ) {
6+ if ( tagsInfo . size > 0 ) return tagsInfo ;
67 posts . map ( ( post ) => {
78 if ( ! post . data . tags ) return ;
89 if ( typeof post . data . tags === "string" ) {
@@ -15,8 +16,9 @@ export async function getTagsInfo() {
1516 return tagsInfo ;
1617}
1718
19+ const catsInfo = new Map < string , number > ( ) ;
1820export function getCatsInfo ( ) {
19- const catsInfo = new Map < string , number > ( ) ;
21+ if ( catsInfo . size > 0 ) return catsInfo ;
2022 posts . map ( ( post ) => {
2123 if ( ! post . data . categories ) return ;
2224 if ( typeof post . data . categories === "string" )
You can’t perform that action at this time.
0 commit comments