Skip to content

Commit

Permalink
🚀 2.6.0 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
EveSunMaple committed Sep 15, 2024
1 parent 4041074 commit e9973c4
Show file tree
Hide file tree
Showing 38 changed files with 1,117 additions and 163 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"i18n-ally.localesPaths": [
"src/locales"
]
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
A simple, elegant, and fast static blog template! 🚀 Built with Astro
</pre>

[**🖥️ Frosti Demo**](https://frosti.saroprock.com)&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;[**🌏 Chinese README**](https://github.com/EveSunMaple/Frosti/blob/main/README.zh-CN.md)&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;[**❤️My Blog**](https://www.saroprock.com)
[**🖥️ Frosti Demo**](https://frosti.saroprock.com)&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;[**🌏 Chinese README**](https://github.com/EveSunMaple/Frosti/blob/main/docs/README.zh-CN.md)&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;[**❤️My Blog**](https://www.saroprock.com)

> [!TIP]
> It is recommended to preview this theme first
## 🖥️ Preview

![view](./Frosti_1.png)
![view](./docs/Frosti_1.png)

## ⏲️ Performance

![speed](./400-lighthouse.png)
![speed](./docs/400-lighthouse.png)

## ✨ Features

Expand Down
5 changes: 5 additions & 0 deletions astro-i18next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('astro-i18next').AstroI18nextConfig} */
export default {
defaultLocale: "en",
locales: ['en', 'zh']
};
7 changes: 5 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import rehypeKatex from "rehype-katex";
import rehypeExternalLinks from 'rehype-external-links';
import playformCompress from "@playform/compress";

import astroI18next from "astro-i18next";

import swup from "@swup/astro";
import SwupScrollPlugin from "@swup/scroll-plugin";
import SwupParallelPlugin from "@swup/parallel-plugin";

import { remarkWordCount } from './src/plugins/remark-word-count.mjs';
import { remarkAddAnchor } from './src/plugins/remark-add-anchor.mjs';
import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs';

// https://astro.build/config
Expand All @@ -39,6 +41,7 @@ export default defineConfig({
sitemap(),
tailwind(),
pagefind(),
astroI18next(),
playformCompress(),
],
markdown: {
Expand Down Expand Up @@ -123,7 +126,7 @@ export default defineConfig({
},
],
},
remarkPlugins: [remarkMath, remarkWordCount, remarkReadingTime],
remarkPlugins: [remarkMath, remarkAddAnchor, remarkReadingTime],
rehypePlugins: [rehypeKatex,
[
rehypeExternalLinks,
Expand Down
File renamed without changes
69 changes: 69 additions & 0 deletions CHANGELOG.md → docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,72 @@

- 修复了评论系统反应表情加载不出来的问题(图床垮了)
- 修复了 `global.scss` 中错误的 applt 拼写

## [2.6.0] - 2024-9-15

### Features

- 新增了导航栏的逻辑,现在点击按钮也可以收回(🚧 此内容可能存在问题,需要收集更多信息 🚧)
- 为每一个标题添加了按钮,您可以将指针放在标题上,点击按钮即可跳转
- 为卡片图片添加了一个跳转样式,鼠标放上后会有一个放大的动画与箭头
- 为链接添加了新的样式,现在它们更生动、更引人注目
- 添加了字数统计与阅读时间计算的功能,您可以在博客中看到它们的统计结果
- 新增分享功能,现在您可以通过文末按钮直接将文章分享到社交媒体上
- 新增 i18n ,移除了老旧的 `infoTest` ,现在所有的语言都在 `public/locales` 文件夹中

这意味着您可以添加多种语言并随时切换,教程如下:

1.`public/locales` 文件夹中添加您的语言文件,先添加一个名为语言代码的文件夹,然后在里面添加一个 json 文件,文件名必须为 `translation.json`
2. 复制已有的 `translation.json` 文件,然后修改其中的内容,比如:

```json
{
"label": {
"noTag": "No tags assigned",
"tagCard": "Tags",
"tagPage": "Tag - ",
"noCategory": "No categories assigned",
"categoryCard": "Categories",
"categoryPage": "Category - ",
"link": "Link: ",
"prevPage": "Recent posts",
"nextPage": "Older posts",
"wordCount": "words",
"readTime": "minutes"
}
}
```

3. 在 `astro-i18next.config.mjs` 中添加您的语言代码,比如:

```mjs
export default {
defaultLocale: "en",
locales: ['en', 'zh', 'xx'] // 这里添加您的语言代码
};
```

4. 在 'BaseLoyout.astro' 中更改为您的语言代码,比如:

```astro
...
import i18next, { t, changeLanguage } from "i18next";

changeLanguage("xx");
...
```

> [!NOTE]
> 欢迎大家为主题添加语言支持!

### Refactored

- 新增 docs 文件夹
- 修改了 blockquote 的内边距
- 修改标签页标题,坚持内容优先,把 `${SITE_TAB} - ${title}` 改成了 `${title} - ${SITE_TAB}`

### Fix

- 修复了在标题与 alert 中错误的外链 svg 样式
- 修复了 toc 错误获取 # 的问题
- 修复了导航栏逻辑
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frosti",
"type": "module",
"version": "2.5.6",
"version": "2.6.0",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand All @@ -25,9 +25,13 @@
"@types/react-dom": "^18.3.0",
"@vercel/analytics": "^1.3.1",
"astro": "^4.15.4",
"astro-i18next": "1.0.0-beta.21",
"astro-icon": "^1.1.1",
"astro-pagefind": "^1.6.0",
"dayjs": "^1.11.13",
"hastscript": "^9.0.0",
"i18next": "^23.15.1",
"i18next-fs-backend": "^2.3.2",
"katex": "^0.16.11",
"mdast-util-to-string": "^4.0.0",
"medium-zoom": "^1.1.0",
Expand All @@ -39,11 +43,13 @@
"reading-time": "^1.5.0",
"rehype-external-links": "^3.0.0",
"rehype-katex": "^7.0.1",
"remark-directive": "^3.0.0",
"remark-math": "^6.0.0",
"sass": "^1.78.0",
"shiki": "^1.16.2",
"swup": "^4.7.0",
"typescript": "^5.5.4"
"typescript": "^5.5.4",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
Expand All @@ -58,4 +64,4 @@
"@iconify/tools": "^4.0.5"
}
}
}
}
Loading

0 comments on commit e9973c4

Please sign in to comment.