From bd53664963e5ee99301b4b2946b262db56bdfd68 Mon Sep 17 00:00:00 2001 From: EveSunMaple Date: Fri, 19 Jul 2024 12:08:11 +0800 Subject: [PATCH] v2.3.1 --- CHANGELOG.md | 7 +++++++ astro.config.mjs | 12 ++++++------ package-lock.json | 4 ++-- package.json | 2 +- src/content/blog/How-to-customize-code-box.mdx | 12 ++++++++---- src/scripts/copybutton.mjs | 1 - src/styles/global.scss | 5 ++++- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47e7d05..2ea0ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,3 +129,10 @@ ### Refactored - 修改了 `astro.config.mjs` 现在代码框样式完全了 + +## [2.3.1] - 2024-7-19 + +## Fix + +- 修复了 `astro.config.mjs` 中的问题(我填错了位置了) +- 完善了白天的代码框样式 diff --git a/astro.config.mjs b/astro.config.mjs index bafa1e4..c1f8da7 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -11,18 +11,18 @@ import pagefind from "astro-pagefind"; export default defineConfig({ site: 'https://www.saroprock.com', style: { - shikiConfig: { - themes: { - light: 'github-dark', - dark: 'github-dark', - }, - }, scss: { includePaths: ['./src/styles'] } }, integrations: [mdx(), sitemap(), tailwind(), playformCompress(), pagefind()], markdown: { + shikiConfig: { + themes: { + light: 'github-light', + dark: 'github-dark', + }, + }, remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex] }, diff --git a/package-lock.json b/package-lock.json index 9a60604..632252e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "frosti", - "version": "2.3.0", + "version": "2.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "frosti", - "version": "2.3.0", + "version": "2.3.1", "dependencies": { "@astrojs/check": "^0.7.0", "@astrojs/mdx": "^2.3.1", diff --git a/package.json b/package.json index a7059a4..687789e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frosti", "type": "module", - "version": "2.3.0", + "version": "2.3.1", "scripts": { "dev": "astro dev", "start": "astro dev", diff --git a/src/content/blog/How-to-customize-code-box.mdx b/src/content/blog/How-to-customize-code-box.mdx index f0d52aa..aa62a25 100644 --- a/src/content/blog/How-to-customize-code-box.mdx +++ b/src/content/blog/How-to-customize-code-box.mdx @@ -50,11 +50,15 @@ Frosti 使用 `Shiki` 来渲染代码框, `Shiki` 已经提供了足够多的 有关于 `Shiki` 的主题详见:https://shiki.style/themes -在 `astro.config.mjs` 中修改内容(某些内容不需要): +在 `astro.config.mjs` 中修改内容: ```js -themes: { - light: 'github-light', // 白天主题 - dark: 'github-dark', // 夜晚主题 +markdown: { + shikiConfig: { + themes: { + light: 'github-light', + dark: 'github-dark', + }, + }, }, ``` \ No newline at end of file diff --git a/src/scripts/copybutton.mjs b/src/scripts/copybutton.mjs index 84f47af..307b665 100644 --- a/src/scripts/copybutton.mjs +++ b/src/scripts/copybutton.mjs @@ -12,7 +12,6 @@ document.addEventListener('astro:page-load', () => { copyButton.style.width = '30px'; copyButton.style.height = '30px'; copyButton.style.borderRadius = '4px'; - copyButton.style.color = '#fff'; copyButton.style.border = 'none'; copyButton.style.zIndex = 100; diff --git a/src/styles/global.scss b/src/styles/global.scss index c955d86..5f175e2 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -6,7 +6,10 @@ html { @apply scroll-smooth; } - +.astro-code, +.astro-code span { + background-color: oklch(var(--b2)) !important; +} html[data-theme="dracula"] { --pagefind-ui-primary: oklch(var(--nc)); --pagefind-ui-text: oklch(var(--nc));