From f81c31f1e67dd3cc3cd71bbda92ccd5c523bad10 Mon Sep 17 00:00:00 2001 From: hongui Date: Wed, 3 Sep 2025 20:05:17 +0800 Subject: [PATCH 01/10] Move to coredivedev --- astro.config.mjs | 2 +- src/components/StructData.astro | 6 +++--- src/content/about/index.en.mdx | 4 ++-- .../index.md | 6 +++--- src/i18n/ui.ts | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index a4b00ac..84bbd6f 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -5,7 +5,7 @@ import sitemap from '@astrojs/sitemap'; import tailwind from '@astrojs/tailwind'; export default defineConfig({ - site: 'https://deep-thinking.top', + site: 'https://coredive.dev', integrations: [mdx(), sitemap( { i18n: { diff --git a/src/components/StructData.astro b/src/components/StructData.astro index 89c0bd6..148dd4c 100644 --- a/src/components/StructData.astro +++ b/src/components/StructData.astro @@ -12,7 +12,7 @@ const isoDate = new Date(publishDate).toISOString(); "author": { "@type": "Person", "name": "低头沉思", - "url": "https://deep-thinking.top/zh/about/" + "url": "https://coredive.dev/zh/about/" } } ` @@ -22,7 +22,7 @@ const isoDate = new Date(publishDate).toISOString(); "@type": "Person", "name": "低头沉思", "jobTitle": "Android工程师", - "url": "https://deep-thinking.top/zh/about/", + "url": "https://coredive/zh/about/", "sameAs": ["https://github.com/hongui"] }` }else if(category==='home'){ @@ -30,7 +30,7 @@ const isoDate = new Date(publishDate).toISOString(); "@context": "https://schema.org", "@type": "WebSite", "name": "低头沉思", - "url": "https://deep-thinking.top/" + "url": "https://coredive.dev/" }` } --- diff --git a/src/content/about/index.en.mdx b/src/content/about/index.en.mdx index 31f8cd0..febd6b8 100644 --- a/src/content/about/index.en.mdx +++ b/src/content/about/index.en.mdx @@ -1,6 +1,6 @@ --- title: "About me" -description: "about deep thinking" +description: "about coredivedev" date: 2022-07-26T23:35:00+08:00 --- @@ -9,7 +9,7 @@ import Wechat from "../../assets/wechat.svg"; import Email from "../../assets/email.svg"; import Contact from "../../components/Contact.astro"; -# Deep thinking +# CoreDiveDev ## Profile Love programming, love being alone ## Technology Stacks diff --git a/src/content/posts/everything-you-need-to-know-to-migrate-from-hugo-to-astro/index.md b/src/content/posts/everything-you-need-to-know-to-migrate-from-hugo-to-astro/index.md index 8487839..0f7392d 100644 --- a/src/content/posts/everything-you-need-to-know-to-migrate-from-hugo-to-astro/index.md +++ b/src/content/posts/everything-you-need-to-know-to-migrate-from-hugo-to-astro/index.md @@ -219,8 +219,8 @@ return Astro.rewrite("/zh") ```typescript export const ui = { en: { - 'title': 'Deep thinking home page', - 'description': 'A home page for deep thinking,share some articles about Android,OpenGLES,Python,HTML/CSS etc.' + 'title': 'CoreDiveDev home page', + 'description': 'A home page for CoreDiveDev,share some articles about Android,OpenGLES,Python,HTML/CSS etc.' }, zh: { 'title': '低头沉思博客主页', @@ -351,7 +351,7 @@ export async function getStaticPaths({ paginate }) { 这里的关键点是提供`posts`的同时,提供`params`,不然会出现`Missing parameter: lng`的错误。 ## 总结 从Hugo迁移到Astro总体来说是比较简单的,但是迁移过程需要按照一定的流程和方法进行,抓大放小,可以大大增强自信心,保证迁移成功。在迁移过程中,首先需要关注的是内容,所以要先将内容导入成功,导入的过程需要接触到路由和页面相关的知识,可以多去官网看看这两部分的内容。其次是个性化的过程中,要首先搞清楚自己的需求,选择合适的工具,做好规划,不然个性化进行到一半,发现有些需求不好实现,推倒重来的代价就比较大了,这部分我推荐使用`Tailwind CSS`。 -如果你有看得不明白的地方,欢迎到 https://github.com/hongui/hongui.github.io 查看我对应的源码。我尽可能地减少了封装,保证了代码的纯粹度。也欢迎大家去我的博客网站 (https://deep-thinking.top/) 上看看实际的显示效果。 +如果你有看得不明白的地方,欢迎到 https://github.com/hongui/hongui.github.io 查看我对应的源码。我尽可能地减少了封装,保证了代码的纯粹度。也欢迎大家去我的博客网站 (https://coredive.dev/) 上看看实际的显示效果。 ## 参考 1. [Astro](https://docs.astro.build/) diff --git a/src/i18n/ui.ts b/src/i18n/ui.ts index 3cf264f..b008953 100644 --- a/src/i18n/ui.ts +++ b/src/i18n/ui.ts @@ -9,9 +9,9 @@ export const defaultLanguage = 'zh'; export const ui = { en: { - 'title': 'Deep thinking home page', - 'description': 'A home page for deep thinking,share some articles about Android,OpenGLES,Python,HTML/CSS etc.', - 'website': 'Deep thinking', + 'title': 'CoreDiveDev home page', + 'description': 'A home page for CoreDiveDev,share some articles about Android,OpenGLES,Python,HTML/CSS etc.', + 'website': 'CoreDiveDev', 'welcome': 'Welcome to my website', 'last_updates': 'Latest updates', 'load_more': 'Load more', @@ -24,7 +24,7 @@ export const ui = { 'tags.title': 'Total Tags', 'tags.description': 'The tags of posts', 'about.title': 'About me', - 'about.description': 'About me,my(Deep thinking) personal resume' + 'about.description': 'About me,my(CoreDiveDev) personal resume' }, zh: { 'title': '低头沉思博客主页', From 8d2460e753227dc0efd377ac9b8b2073f84c1c20 Mon Sep 17 00:00:00 2001 From: hongui Date: Wed, 3 Sep 2025 20:40:43 +0800 Subject: [PATCH 02/10] Fix link --- src/components/StructData.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/StructData.astro b/src/components/StructData.astro index 148dd4c..7c2ba05 100644 --- a/src/components/StructData.astro +++ b/src/components/StructData.astro @@ -22,7 +22,7 @@ const isoDate = new Date(publishDate).toISOString(); "@type": "Person", "name": "低头沉思", "jobTitle": "Android工程师", - "url": "https://coredive/zh/about/", + "url": "https://coredive.dev/zh/about/", "sameAs": ["https://github.com/hongui"] }` }else if(category==='home'){ From ae712a6f7914cedc777e4bcbc4e8b61bea91e1a7 Mon Sep 17 00:00:00 2001 From: hongui Date: Wed, 3 Sep 2025 21:06:02 +0800 Subject: [PATCH 03/10] Update deps --- astro.config.mjs | 3 --- package.json | 16 ++++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 84bbd6f..85b131d 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -20,9 +20,6 @@ export default defineConfig({ }, image: { service: passthroughImageService(), - }, - experimental:{ - svg: true } }, ); \ No newline at end of file diff --git a/package.json b/package.json index b3802ce..203930f 100644 --- a/package.json +++ b/package.json @@ -9,15 +9,15 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^4.0.0", - "@astrojs/rss": "^4.0.9", - "@astrojs/sitemap": "^3.2.1", - "@astrojs/tailwind": "^5.1.3", - "astro": "^5.0.0", - "firebase": "^11.0.2", - "tailwindcss": "^3.4.16" + "@astrojs/mdx": "4.3.4", + "@astrojs/rss": "4.0.12", + "@astrojs/sitemap": "3.5.1", + "@astrojs/tailwind": "6.0.2", + "astro": "5.13.5", + "firebase": "12.2.1", + "tailwindcss": "4.1.12" }, "devDependencies": { - "@tailwindcss/typography": "^0.5.15" + "@tailwindcss/typography": "0.5.16" } } \ No newline at end of file From f2bd637d72e96f2ebabe5edb2d1ed662792a1635 Mon Sep 17 00:00:00 2001 From: hongui Date: Wed, 3 Sep 2025 21:12:52 +0800 Subject: [PATCH 04/10] Update svg config --- astro.config.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/astro.config.mjs b/astro.config.mjs index 85b131d..30b5787 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -20,6 +20,11 @@ export default defineConfig({ }, image: { service: passthroughImageService(), + }, + experimental:{ + svg: { + mode: 'sprite' + } } }, ); \ No newline at end of file From 6256b3f1a91176b2aa5aa69f4124941313c37eac Mon Sep 17 00:00:00 2001 From: hongui Date: Wed, 3 Sep 2025 21:41:10 +0800 Subject: [PATCH 05/10] Update config --- astro.config.mjs | 15 ++++++--------- package.json | 5 ++++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 30b5787..ae99435 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,7 +2,7 @@ import { defineConfig, passthroughImageService } from 'astro/config'; import mdx from '@astrojs/mdx'; import sitemap from '@astrojs/sitemap'; -import tailwind from '@astrojs/tailwind'; +import tailwindcss from "@tailwindcss/vite"; export default defineConfig({ site: 'https://coredive.dev', @@ -13,7 +13,7 @@ export default defineConfig({ locales: {zh:'zh-CN', en:'en-US'}, }, } - ), tailwind()], + )], i18n: { defaultLocale: 'zh', locales: ['zh', 'en'], @@ -21,10 +21,7 @@ export default defineConfig({ image: { service: passthroughImageService(), }, - experimental:{ - svg: { - mode: 'sprite' - } - } -}, -); \ No newline at end of file + vite: { + plugins: [tailwindcss()], + }, +},); \ No newline at end of file diff --git a/package.json b/package.json index 203930f..7ab11d2 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,16 @@ "astro": "astro" }, "dependencies": { + "@astrojs/check": "0.9.4", "@astrojs/mdx": "4.3.4", "@astrojs/rss": "4.0.12", "@astrojs/sitemap": "3.5.1", "@astrojs/tailwind": "6.0.2", + "@tailwindcss/vite": "4.1.12", "astro": "5.13.5", "firebase": "12.2.1", - "tailwindcss": "4.1.12" + "tailwindcss": "4.1.12", + "typescript": "5.9.2" }, "devDependencies": { "@tailwindcss/typography": "0.5.16" From 78ee734831e06986158172ba0f2781eee4c11cb5 Mon Sep 17 00:00:00 2001 From: hongui Date: Wed, 3 Sep 2025 21:46:56 +0800 Subject: [PATCH 06/10] Update taillwindcss --- src/styles/global.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/styles/global.css b/src/styles/global.css index 8ea77ff..bfc82e9 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -3,9 +3,7 @@ https://github.com/HermanMartinus/bearblog/blob/297026a877bc2ab2b3bdfbd6b9f7961c350917dd/templates/styles/blog/default.css License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md */ - @tailwind base; - @tailwind components; - @tailwind utilities; + @reference "tailwindcss"; @layer base { :root { From 49e08daa609243f9c1b93c0b62f2e3884a566f66 Mon Sep 17 00:00:00 2001 From: hongui Date: Wed, 3 Sep 2025 23:06:50 +0800 Subject: [PATCH 07/10] Update wrangler --- wrangler.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wrangler.toml b/wrangler.toml index 5dc11e6..f0d632f 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,7 +1,10 @@ -name = "blogs" -compatibility_date = "2024-07-29" +name = "coredivedev" +compatibility_date = "2025-04-01" compatibility_flags = ["nodejs_compat"] -pages_build_output_dir = "./dist" + +[assets] +directory: "./dist/" +not_found_handling = "404-page" [vars] NODE_VERSION = "20.0.0" From adf4035b8c609bd6c1669cd8d3a43528d47f6183 Mon Sep 17 00:00:00 2001 From: hongui Date: Thu, 4 Sep 2025 23:15:12 +0800 Subject: [PATCH 08/10] Add wrangler --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ab11d2..da9d036 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "typescript": "5.9.2" }, "devDependencies": { - "@tailwindcss/typography": "0.5.16" + "@tailwindcss/typography": "0.5.16", + "wrangler": "4.33.2" } } \ No newline at end of file From 62c3f7205d1cfa576e1762b58db7ac691f480ab3 Mon Sep 17 00:00:00 2001 From: hongui Date: Thu, 4 Sep 2025 23:21:32 +0800 Subject: [PATCH 09/10] Update config --- wrangler.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrangler.toml b/wrangler.toml index f0d632f..4664d7a 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -3,7 +3,7 @@ compatibility_date = "2025-04-01" compatibility_flags = ["nodejs_compat"] [assets] -directory: "./dist/" +directory = "./dist/" not_found_handling = "404-page" [vars] From 4f8724bf71e94bc07859dafa2a7febe8fd165b50 Mon Sep 17 00:00:00 2001 From: "cloudflare-workers-and-pages[bot]" <73139402+cloudflare-workers-and-pages[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 13:08:20 +0000 Subject: [PATCH 10/10] Update wrangler config name to blog --- wrangler.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrangler.toml b/wrangler.toml index 4664d7a..7dc2cfc 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,4 +1,4 @@ -name = "coredivedev" +name = "blog" compatibility_date = "2025-04-01" compatibility_flags = ["nodejs_compat"]