diff --git a/astro.config.mjs b/astro.config.mjs index 8e89f5d..1e1d14e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -16,6 +16,8 @@ import swup from "@swup/astro"; import { remarkAddAnchor } from './src/plugins/remark-add-anchor.mjs'; import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs'; +import dotenv from 'dotenv'; +dotenv.config(); const { USER_SITE } = await import('./src/consts.ts'); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c4f2d7a..d99eb79 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -474,4 +474,46 @@ - 修复了文章在标签、分类过多时按钮溢出的问题 - 修复了一堆拼写错误(存在于 2.6.0 的 release 中) - 删除了在 LinkCard 中不恰当的图片放大功能 -- 移除了 `transition.scss` ,改用 swup 默认主题代替(我不知道这对改善崩溃问题是否有用) \ No newline at end of file +- 移除了 `transition.scss` ,改用 swup 默认主题代替(我不知道这对改善崩溃问题是否有用) + +## [2.7.0] - 2024-10-12 + +### Features + +- 添加昼夜转换过渡 +- 自定义了博客中的标题 `ID` ,当前命名格式为 `heading-${headingCount}` ,避免了出现同名标题无法跳转的问题 +- 为博客目录功能添加了 "聚焦" 功能,现在目录会根据您当前阅读的部分自动滚动 +- 为博客 `main` 中的卡片添加了逐次进入样式,使用 `sass` 制作: + + ```scss + .fade-in-up { + opacity: 0; + transform: translateY(50px); + animation: fadeInUp 0.5s ease forwards; + + @for $i from 1 through 10 { + &:nth-child(#{$i}) { + animation-delay: #{$i * 0.1}s; + } + } + } + + @keyframes fadeInUp { + to { + opacity: 1; + transform: translateY(0); + } + } + ``` + +### Refactored + +- 修改了原网站图标 +- 修改了原不规范的文件命名 +- 修改了原不合理的布局 +- 修改了侧边栏按钮的样式,使用 `join` 组合元素 +- 微调 `padding` + +### Fix + +- 修复了在重名 `ID` 下无法跳转的问题 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9de383c..c1e1645 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "frosti", - "version": "2.6.0", + "version": "2.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "frosti", - "version": "2.6.0", + "version": "2.7.0", "dependencies": { "@astrojs/check": "^0.9.3", "@astrojs/mdx": "^3.1.5", diff --git a/package.json b/package.json index cf55f98..3d7ab7e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frosti", "type": "module", - "version": "2.6.0", + "version": "2.7.0", "scripts": { "dev": "astro dev", "start": "astro dev", @@ -17,6 +17,7 @@ "@astrojs/sitemap": "^3.1.6", "@astrojs/tailwind": "^5.1.1", "@astrojs/vercel": "^7.8.1", + "@notionhq/client": "^2.2.15", "@playform/compress": "^0.0.13", "@swup/astro": "^1.4.1", "@swup/parallel-plugin": "^0.4.0", @@ -30,10 +31,12 @@ "astro-icon": "^1.1.1", "astro-pagefind": "^1.6.0", "dayjs": "^1.11.13", + "dotenv": "^16.4.5", "hastscript": "^9.0.0", "i18next": "^23.15.1", "i18next-fs-backend": "^2.3.2", "katex": "^0.16.11", + "marked": "^14.1.2", "mdast-util-to-string": "^4.0.0", "medium-zoom": "^1.1.0", "pagefind": "^1.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7d6f67..87c779a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,9 @@ importers: '@astrojs/vercel': specifier: ^7.8.1 version: 7.8.1(astro@4.15.8(@types/node@22.5.5)(lightningcss@1.25.1)(rollup@2.79.1)(sass@1.79.3)(terser@5.33.0)(typescript@5.6.2))(react@18.3.1) + '@notionhq/client': + specifier: ^2.2.15 + version: 2.2.15 '@playform/compress': specifier: ^0.0.13 version: 0.0.13(@types/node@22.5.5)(rollup@2.79.1)(sass@1.79.3)(typescript@5.6.2) @@ -71,6 +74,9 @@ importers: dayjs: specifier: ^1.11.13 version: 1.11.13 + dotenv: + specifier: ^16.4.5 + version: 16.4.5 hastscript: specifier: ^9.0.0 version: 9.0.0 @@ -83,6 +89,9 @@ importers: katex: specifier: ^0.16.11 version: 0.16.11 + marked: + specifier: ^14.1.2 + version: 14.1.2 mdast-util-to-string: specifier: ^4.0.0 version: 4.0.0 @@ -1353,6 +1362,10 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@notionhq/client@2.2.15': + resolution: {integrity: sha512-XhdSY/4B1D34tSco/GION+23GMjaS9S2zszcqYkMHo8RcWInymF6L1x+Gk7EmHdrSxNFva2WM8orhC4BwQCwgw==} + engines: {node: '>=12'} + '@oslojs/encoding@0.4.1': resolution: {integrity: sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q==} @@ -1738,6 +1751,9 @@ packages: '@types/nlcst@2.0.3': resolution: {integrity: sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==} + '@types/node-fetch@2.6.11': + resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} + '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} @@ -2449,6 +2465,10 @@ packages: dot-case@3.0.4: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} + dotenv@16.4.5: + resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} + engines: {node: '>=12'} + dset@3.1.4: resolution: {integrity: sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==} engines: {node: '>=4'} @@ -3483,6 +3503,11 @@ packages: markdown-table@3.0.3: resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==} + marked@14.1.2: + resolution: {integrity: sha512-f3r0yqpz31VXiDB/wj9GaOB0a2PRLQl6vJmXiFrniNwjkKdvakqJRULhjFKJpxOchlCRiG5fcacoUZY5Xa6PEQ==} + engines: {node: '>= 18'} + hasBin: true + maxmin@2.1.0: resolution: {integrity: sha512-NWlApBjW9az9qRPaeg7CX4sQBWwytqz32bIEo1PW9pRW+kBP9KLRfJO3UC+TV31EcQZEUq7eMzikC7zt3zPJcw==} engines: {node: '>=0.12'} @@ -6673,6 +6698,13 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + '@notionhq/client@2.2.15': + dependencies: + '@types/node-fetch': 2.6.11 + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + '@oslojs/encoding@0.4.1': {} '@pagefind/darwin-arm64@1.1.1': @@ -7100,6 +7132,11 @@ snapshots: dependencies: '@types/unist': 3.0.3 + '@types/node-fetch@2.6.11': + dependencies: + '@types/node': 22.5.5 + form-data: 4.0.0 + '@types/node@17.0.45': {} '@types/node@20.14.2': @@ -8078,6 +8115,8 @@ snapshots: no-case: 3.0.4 tslib: 2.7.0 + dotenv@16.4.5: {} + dset@3.1.4: {} duplexer@0.1.1: {} @@ -9175,6 +9214,8 @@ snapshots: markdown-table@3.0.3: {} + marked@14.1.2: {} + maxmin@2.1.0: dependencies: chalk: 1.1.3 diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index b54f43e..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/favicon.svg b/public/favicon.svg index f157bd1..0ee6729 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1,9 +1 @@ - + \ No newline at end of file diff --git a/src/components/BaseCard.astro b/src/components/BaseCard.astro index 2646530..32a5511 100644 --- a/src/components/BaseCard.astro +++ b/src/components/BaseCard.astro @@ -24,7 +24,7 @@ const hasTags = tags && tags.length > 0; ---