From cf680c4d179352bd4792f2912c64ee3a0f8f7aa5 Mon Sep 17 00:00:00 2001
From: Ryan Wang
Date: Tue, 7 Apr 2026 22:52:16 +0800
Subject: [PATCH] Refactor
---
.editorconfig | 12 -
.eslintrc.cjs | 20 -
.gitignore | 39 +-
.npmrc | 2 -
.prettierignore | 3 +
.vscode/launch.json | 11 -
.vscode/settings.json | 6 +
README.md | 61 +-
astro.config.mjs | 16 +-
env.d.ts | 8 -
i18n/default.properties | 3 -
i18n/en.properties | 3 -
i18n/zh.properties | 3 -
package.json | 51 +-
pnpm-lock.yaml | 9507 ++++++++++-------
pnpm-workspace.yaml | 3 +
prettier.config.js | 3 -
public/about.html | 17 -
public/favicon.ico | Bin 4286 -> 0 bytes
settings.yaml | 72 -
src/components/Card.astro | 74 -
src/components/Footer.astro | 33 +
src/components/Header.astro | 101 +
src/components/PostCard.vue | 52 -
src/components/ThemeSwitcher.vue | 90 +
src/env.d.ts | 13 +
src/layouts/Layout.astro | 107 +-
src/pages/archives.astro | 65 +
src/pages/categories.astro | 25 +
src/pages/category.astro | 59 +
src/pages/index.astro | 134 +-
src/pages/links.astro | 73 -
src/pages/page.astro | 25 +
src/pages/post.astro | 32 +-
src/pages/tag.astro | 59 +
src/pages/tags.astro | 21 +
src/styles/global.css | 465 +
tailwind.config.cjs | 8 -
templates/about.html | 17 -
templates/archives.html | 13 +
templates/assets/Layout.CBfLtUah.css | 1 +
templates/assets/PostCard.ccb901a8.js | 4 -
templates/assets/ThemeSwitcher.YRqkXSdT.js | 1 +
.../runtime-core.esm-bundler.2be6ca71.js | 1 -
templates/assets/client.396edee1.js | 1 -
templates/assets/client.DVUslHZS.js | 1 +
.../assets/index-links-post.be069062.css | 1 -
templates/assets/index.396b2b11.css | 1 -
templates/assets/links.5e24488a.css | 1 -
.../runtime-core.esm-bundler.25dbJ6OW.js | 3 +
templates/categories.html | 13 +
templates/category.html | 13 +
templates/favicon.ico | Bin 4286 -> 0 bytes
templates/index.html | 99 +-
templates/links.html | 78 -
templates/page.html | 13 +
templates/post.html | 37 +-
templates/tag.html | 13 +
templates/tags.html | 13 +
theme.yaml | 25 +-
tsconfig.json | 21 +-
61 files changed, 6826 insertions(+), 4820 deletions(-)
delete mode 100644 .editorconfig
delete mode 100644 .eslintrc.cjs
delete mode 100644 .npmrc
create mode 100644 .prettierignore
delete mode 100644 .vscode/launch.json
create mode 100644 .vscode/settings.json
delete mode 100644 env.d.ts
delete mode 100644 i18n/default.properties
delete mode 100644 i18n/en.properties
delete mode 100644 i18n/zh.properties
create mode 100644 pnpm-workspace.yaml
delete mode 100644 prettier.config.js
delete mode 100644 public/about.html
delete mode 100644 public/favicon.ico
delete mode 100644 settings.yaml
delete mode 100644 src/components/Card.astro
create mode 100644 src/components/Footer.astro
create mode 100644 src/components/Header.astro
delete mode 100644 src/components/PostCard.vue
create mode 100644 src/components/ThemeSwitcher.vue
create mode 100644 src/env.d.ts
create mode 100644 src/pages/archives.astro
create mode 100644 src/pages/categories.astro
create mode 100644 src/pages/category.astro
delete mode 100644 src/pages/links.astro
create mode 100644 src/pages/page.astro
create mode 100644 src/pages/tag.astro
create mode 100644 src/pages/tags.astro
create mode 100644 src/styles/global.css
delete mode 100644 tailwind.config.cjs
delete mode 100644 templates/about.html
create mode 100644 templates/archives.html
create mode 100644 templates/assets/Layout.CBfLtUah.css
delete mode 100644 templates/assets/PostCard.ccb901a8.js
create mode 100644 templates/assets/ThemeSwitcher.YRqkXSdT.js
delete mode 100644 templates/assets/chunks/runtime-core.esm-bundler.2be6ca71.js
delete mode 100644 templates/assets/client.396edee1.js
create mode 100644 templates/assets/client.DVUslHZS.js
delete mode 100644 templates/assets/index-links-post.be069062.css
delete mode 100644 templates/assets/index.396b2b11.css
delete mode 100644 templates/assets/links.5e24488a.css
create mode 100644 templates/assets/runtime-core.esm-bundler.25dbJ6OW.js
create mode 100644 templates/categories.html
create mode 100644 templates/category.html
delete mode 100644 templates/favicon.ico
delete mode 100644 templates/links.html
create mode 100644 templates/page.html
create mode 100644 templates/tag.html
create mode 100644 templates/tags.html
diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 53fe054..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-# EditorConfig is awesome: https://EditorConfig.org
-
-# top-most EditorConfig file
-root = true
-
-[*]
-indent_style = space
-indent_size = 2
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = false
-insert_final_newline = true
\ No newline at end of file
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
deleted file mode 100644
index 269cede..0000000
--- a/.eslintrc.cjs
+++ /dev/null
@@ -1,20 +0,0 @@
-/* eslint-env node */
-require("@rushstack/eslint-patch/modern-module-resolution");
-
-module.exports = {
- root: true,
- extends: [
- "plugin:vue/vue3-essential",
- "eslint:recommended",
- "@vue/eslint-config-typescript/recommended",
- "@vue/eslint-config-prettier",
- ],
- env: {
- node: true,
- "vue/setup-compiler-macros": true,
- },
- rules: {
- "vue/multi-word-component-names": 0,
- "@typescript-eslint/ban-ts-comment": 0,
- },
-};
diff --git a/.gitignore b/.gitignore
index f828697..a0cee65 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,29 +1,24 @@
-# Logs
-logs
-*.log
+# build output
+dist/
+# generated types
+.astro/
+
+# dependencies
+node_modules/
+
+# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
-lerna-debug.log*
-node_modules
+
+# environment variables
+.env
+.env.production
+
+# macOS-specific files
.DS_Store
-dist
-dist-ssr
-histoire-dist
-coverage
-*.local
-/cypress/videos/
-/cypress/screenshots/
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
-.idea
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
+# jetbrains setting folder
+.idea/
\ No newline at end of file
diff --git a/.npmrc b/.npmrc
deleted file mode 100644
index ef83021..0000000
--- a/.npmrc
+++ /dev/null
@@ -1,2 +0,0 @@
-# Expose Astro dependencies for `pnpm` users
-shamefully-hoist=true
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..bde9e3f
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,3 @@
+templates/
+pnpm-lock.yaml
+pnpm-workspace.yaml
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index d642209..0000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "version": "0.2.0",
- "configurations": [
- {
- "command": "./node_modules/.bin/astro dev",
- "name": "Development server",
- "request": "launch",
- "type": "node-terminal"
- }
- ]
-}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..8f50254
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,6 @@
+{
+ "emmet.includeLanguages": {
+ "astro": "html"
+ },
+ "i18n-ally.localesPaths": ["demo-themes/theme-earth/i18n"]
+}
diff --git a/README.md b/README.md
index 011d75a..6d3f665 100644
--- a/README.md
+++ b/README.md
@@ -1,60 +1 @@
-# theme-astro-starter(Experimental)
-
-Halo 2.0 基于 [Astro](https://astro.build) 和 [Thymeleaf](https://www.thymeleaf.org/) 的主题快速开始模板。
-
-> 目前还处于实验和探索的阶段。
-
-## 原理
-
-1. Astro 作为 SSG 渲染框架,用于组件封装、页面框架组织、静态页面生成、静态资源的构建。
-2. Thymeleaf 作为后端页面渲染框架,并且负责提供数据进行页面数据的渲染。由于 Thymeleaf 的语法是基于 HTML 元素的 Attributes 扩展,所以理论上并不会破坏 HTML 的结构。那么就可以在 Astro 组件中使用 Halo 提供的数据和页面进行绑定。这样就实现了在开发环境并不依赖于 Halo 后端,可以在开发过程中保留 hmr。并且可以做到在构建之后可以直接给 Halo 使用。
-
-## 特性
-
-1. 得益于 Astro 框架,可以使用现代的前端技术栈开发页面。包括但不限于 Vue React Svelte 等,意味着可以使用这些现代前端框架进行组件开发。
-2. 在开发环境可以实现 hmr。
-3. 在构建页面之后,会自动处理构建产物的资源地址,转换为 Thymeleaf 可识别的语法。
-4. 最终构建的产物可通过 HTML 直接访问,也可以部署在任何静态页面服务器,可作为页面预览原型。但因为没有经过 Halo 进行数据绑定,所以没有数据填充。
-
-## 开发
-
-项目结构:
-
-```text
-├── astro.config.mjs Astro 配置文件
-├── package.json
-├── pnpm-lock.yaml
-├── src
-│ ├── components
-│ │ ├── Card.astro
-│ │ └── PostCard.vue Vue 3 组件
-│ ├── layouts Astro 布局组件
-│ │ └── Layout.astro
-│ └── pages
-│ ├── index.astro Astro 页面组件
-│ └── post.astro
-├── templates
-│ ├── assets bundle 之后的静态资源文件
-│ │ ├── 4669d51c.dbc606a6.css
-│ │ ├── PostCard.42ac9187.js
-│ │ ├── chunks
-│ │ │ └── runtime-core.esm-bundler.e59bb94c.js
-│ │ └── client.e67fc49c.js
-│ ├── favicon.ico
-│ ├── index.html 构建之后的静态页面,作为 Thymeleaf 渲染模板
-│ └── post.html
-├── theme.yaml 主题描述文件
-└── tsconfig.json
-```
-
-```bash
-git clone https://github.com/ruibaby/theme-astro-starter
-
-pnpm install
-
-# 启动 Vite 开发环境
-pnpm dev
-
-# 构建最终产物,构建之后可以直接在 Halo 当中安装使用
-pnpm build
-```
+WIP
\ No newline at end of file
diff --git a/astro.config.mjs b/astro.config.mjs
index 8e9525c..d2c6c2e 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -1,16 +1,14 @@
+// @ts-check
import { defineConfig } from "astro/config";
-import vue from "@astrojs/vue";
-import tailwind from "@astrojs/tailwind";
-import astroHaloThemeIntegration from "@halo-dev/astro-halo-theme-integration";
-// https://astro.build/config
+import vue from "@astrojs/vue";
+
export default defineConfig({
- integrations: [vue(), tailwind(), astroHaloThemeIntegration()],
- outDir: "./templates",
+ base: "/themes/astro-starter",
build: {
+ assets: "assets",
format: "file",
},
- server: {
- port: 4000,
- },
+ outDir: "./templates",
+ integrations: [vue()],
});
diff --git a/env.d.ts b/env.d.ts
deleted file mode 100644
index 9f8f1e2..0000000
--- a/env.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-///
- 没有经过 Astro 渲染,原生使用 Thymeleaf 语法。在构建时,将被 Copy 到 - templates 目录。(Native) -
- - diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 578ad458b8906c08fbed84f42b045fea04db89d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmchZF=!M)6ox0}Fc8GdTHG!cdIY>nA!3n2f|wxIl0rn}Hl#=uf>?-!2r&jMEF^_k zh**lGut*gwBmoNv7AaB&2~nbzULg{WBhPQ{ZVzvF_HL8Cb&hv$_s#qN|IO^o>?+mA zuTW6tU%k~z<&{z+7$G%*nRsTcEO|90xy<-G5&JTt%CgZZCDT4%R?+{Vd^wh>P8_)} z`+dF$HQb9!>1o`Ivn;GInlCw{9T@Rt%q+d^T3Ke%cxkk;$v`{s^zCB9nHAv6w$Vbn z8fb<+eQTNM`;rf9#obfGnV#3+OQEUv4gU;{oA@zol- {body} -
- -+
+ + +
- Check out the src/pages directory to get started.
- Code Challenge: Tweak the "Welcome to Astro" message above.
-
- Onions -
-+
+ + +{data.name}
-{data.description}
-+
+ + +- 没有经过 Astro 渲染,原生使用 Thymeleaf 语法。在构建时,将被 Copy 到 - templates 目录。(Native) -
- - diff --git a/templates/archives.html b/templates/archives.html new file mode 100644 index 0000000..8401a3e --- /dev/null +++ b/templates/archives.html @@ -0,0 +1,13 @@ +B?gt(o,b,y,!0,!1,P):N(u,p,v,b,y,E,C,w,P)},jt=(o,u,p,v,b,y,E,C,w)=>{let m=0;const B=u.length;let P=o.length-1,A=B-1;for(;m<=P&&m<=A;){const H=o[m],q=u[m]=w?He(u[m]):ve(u[m]);if(qe(H,q))R(H,q,p,null,b,y,E,C,w);else break;m++}for(;m<=P&&m<=A;){const H=o[P],q=u[A]=w?He(u[A]):ve(u[A]);if(qe(H,q))R(H,q,p,null,b,y,E,C,w);else break;P--,A--}if(m>P){if(m<=A){const H=A+1,q=HA)for(;m<=P;)Pe(o[m],b,y,!0),m++;else{const H=m,q=m,Z=new Map;for(m=q;m<=A;m++){const xe=u[m]=w?He(u[m]):ve(u[m]);xe.key!=null&&Z.set(xe.key,m)}let z,ie=0;const le=A-q+1;let we=!1,me=0;const _t=new Array(le);for(m=0;m
- Check out the
- Learn how Astro works and explore the official API docs.
-
- Supercharge your project with new frameworks and libraries.
-
- Explore a galaxy of community-built starter themes.
-
- Come say hi to our amazing Discord community. ❤️
-
- Onions
-分类
Welcome to Astro
- src/pages directory to get started.
- Code Challenge: Tweak the "Welcome to Astro" message above.
-
-
-
- Documentation
- →
-
-
- Integrations
- →
-
-
- Themes
- →
-
-
- Chat
- →
-
-
-
-
-
-
- 标签