Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
100f3d0
架构优化:使用边缘函数实现首页重定向,同时加载简单的界面
BlockHaity Nov 21, 2025
473b156
chore: remove unused LanguageRedirect component
BlockHaity Nov 21, 2025
66d8d53
refactor: simplify edge function to return plain text redirects
BlockHaity Nov 21, 2025
181806a
refactor: replace text responses with HTTP redirects
BlockHaity Nov 21, 2025
85028d2
Chore: remove edge function redirect page
BlockHaity Nov 21, 2025
f4c6e89
架构优化:修改站点地图生成脚本
BlockHaity Nov 21, 2025
123ba31
架构优化:所有图片转化为webp,无损压缩
BlockHaity Nov 22, 2025
9b88414
Chore: remove unused checker script and clean download page
BlockHaity Nov 22, 2025
6aed8d1
架构优化:重构下载页
BlockHaity Nov 22, 2025
a6beb77
refactor: restructure download page with OS-specific components
BlockHaity Nov 22, 2025
28ea5c3
feat: add GitHub direct download link for Windows
BlockHaity Nov 22, 2025
6c9bfaf
refactor: add internationalization support for download page
BlockHaity Nov 22, 2025
3ff1565
feat: add BlockHaity API download link
BlockHaity Nov 22, 2025
7bb6f52
Merge pull request #22 from BlueArchiveArisHelper/test
BlockHaity Nov 22, 2025
a5a2b5a
架构优化:检查器重构
BlockHaity Nov 29, 2025
63e1138
refactor: restructure checker scripts with modular functions
BlockHaity Nov 29, 2025
12f50a0
架构优化:添加图片自动优化工作流
BlockHaity Nov 29, 2025
44ef99a
向下兼容vercel
BlockHaity Nov 29, 2025
7755285
Feat: enhance release body formatting with colored labels
Tangbelief Nov 29, 2025
2196f52
Chore: correct typos and improve content readability
Tangbelief Nov 29, 2025
15ff3b6
Chore: corrected the description of Q&A groups in English docs
Tangbelief Nov 29, 2025
b5356b1
Fix: fix the wrong Markdown format in the get support
Tangbelief Nov 29, 2025
a5a2e23
Chore: optimize PR comment ID parsing with grep
BlockHaity Nov 30, 2025
09191de
Chore: simplify PR comment editing with --edit-last flag
BlockHaity Nov 30, 2025
f1ec6af
Chore: update checkout action with repository and ref parameters
BlockHaity Nov 30, 2025
d2742e9
Chore: update checkout action for PR head repository and ref
BlockHaity Nov 30, 2025
fa96ff9
Chore: add file listing step for PR debugging
BlockHaity Nov 30, 2025
8939578
Chore: add TOOLS directory listing in PR check
BlockHaity Nov 30, 2025
c988f7e
Chore: remove file listing and fix TOOLS path in checks
BlockHaity Nov 30, 2025
f98119f
Chore: replace newlines with HTML breaks in PR comments
BlockHaity Nov 30, 2025
cdfb7d5
Chore: remove Markdown headers from PR check comments
BlockHaity Nov 30, 2025
ec355a3
Chore: reorder download links and remove unused code
BlockHaity Nov 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Check PR

on:
pull_request:
types: [opened, synchronize]

jobs:
check:
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout PR code
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Block PR merge
run: |
gh pr review ${{ github.event.pull_request.number }} \
--body "检查开始,请等待。此PR暂时无法合并。" \
--request-changes

- name: Create check comment
id: create_comment
run: |
gh pr comment ${{ github.event.pull_request.number }} \
--body "检查进度<br><br>⏳ 开始检查..."

- name: Check deadlink
run: |
python3 TOOLS/deadlink_checker.py
gh pr comment ${{ github.event.pull_request.number }} \
--edit-last \
--body "检查进度<br><br>✅ 死链检查完成<br>⏳ 正在检查图片..."

- name: Check image
run: |
python3 TOOLS/webp_checker.py
gh pr comment ${{ github.event.pull_request.number }} \
--edit-last \
--body "检查进度<br><br>✅ 死链检查完成<br>✅ 图片检查完成<br>⏳ 检查完成..."

- name: Allow PR merge
if: always()
run: |
if [ -f "error.txt" ]; then
ERROR_CONTENT=$(cat error.txt)
gh pr review ${{ github.event.pull_request.number }} \
--body "❌ 检查未通过,PR无法合并。<br><br>错误信息:<br>\`\`\`<br>$ERROR_CONTENT<br>\`\`\`" \
--request-changes
if [ -f "warn.txt" ]; then
WARN_CONTENT=$(cat warn.txt)
gh pr comment ${{ github.event.pull_request.number }} \
--edit-last \
--body "检查进度<br><br>❌ 检查未通过<br><br>⚠️ 警告信息:<br>\`\`\`<br>$WARN_CONTENT<br>\`\`\`<br><br>❌ 错误信息:<br>\`\`\`<br>$ERROR_CONTENT<br>\`\`\`"
else
gh pr comment ${{ github.event.pull_request.number }} \
--edit-last \
--body "检查进度<br><br>❌ 检查未通过<br><br>❌ 错误信息:<br>\`\`\`<br>$ERROR_CONTENT<br>\`\`\`"
fi
elif [ -f "warn.txt" ]; then
WARN_CONTENT=$(cat warn.txt)
gh pr review ${{ github.event.pull_request.number }} \
--body "⚠️ 检查通过但有警告,PR可以合并。<br><br>警告信息:<br>\`\`\`<br>$WARN_CONTENT<br>\`\`\`" \
--approve
gh pr comment ${{ github.event.pull_request.number }} \
--edit-last \
--body "检查进度<br><br>✅ 检查完成<br><br>⚠️ 警告信息:<br>\`\`\`<br>$WARN_CONTENT<br>\`\`\`<br><br>🎉 PR可以合并"
else
gh pr review ${{ github.event.pull_request.number }} \
--body "检查完成,PR可以合并。" \
--approve
gh pr comment ${{ github.event.pull_request.number }} \
--edit-last \
--body "检查进度<br><br>✅ 所有检查完成<br>🎉 PR可以合并"
fi


34 changes: 34 additions & 0 deletions .github/workflows/image_opti.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Image Optimization

on:
push:
branches:
- main

jobs:
optimize_images:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg python3

- name: Optimize images
run: |
python3 TOOLS/image_opti.py

- name: Commit and push changes
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add -A
if ! git diff --cached --quiet; then
git commit -m "Optimize images"
git push origin main
fi
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/dist
/pnpm-lock.yaml
/server
/.idea
/.idea
/TOOLS/__pycache__
36 changes: 0 additions & 36 deletions .vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,45 +41,9 @@ export default defineConfig({
logo: '/img/website/icon.png',
// https://vitepress.dev/reference/default-theme-config
nav: [
// { text: '主页', link: '/' },
// { text: '下载', link: '/zh_CN/download' }
],

sidebar: [
// { text: '主页', link: '/' },
// { text: '下载', link: '/zh_CN/download' },
// {
// text: '使用文档', items: [
// { text: '快速开始', link: '/zh_CN/docs/manual/quick-start' },
// { text: '从源码部署', link: '/zh_CN/docs/manual/source-code' },
// {
// text: '功能介绍',
// collapsed: true,
// items: [
// { text: '刷取关卡', link: '/zh_CN/docs/manual/introduction/sweep-level' },
// { text: '课程表', link: '/zh_CN/docs/manual/introduction/lesson' },
// { text: '商店', link: '/zh_CN/docs/manual/introduction/shop' },
// { text: '咖啡馆', link: '/zh_CN/docs/manual/introduction/cafe' },
// { text: '总力战', link: '/zh_CN/docs/manual/introduction/assault' },
// { text: '推图', link: '/zh_CN/docs/manual/introduction/explore-stage' },
// { text: '小工具', link: '/zh_CN/docs/manual/introduction/tools' },
// { text: '通知', link: '/zh_CN/docs/manual/introduction/notification' },
// ]
// },
// { text: '自动化运行', link: '/zh_CN/docs/manual/automated-operation' },
// { text: '获取支持', link: '/zh_CN/docs/manual/get-support' },
// { text: 'Q&A 常见问题', link: '/zh_CN/docs/manual/QA' },
// ]
// },
// {
// text: '开发文档', items: [
// { text: '环境搭建', link: '/zh_CN/docs/dev/dev-env' },
// { text: '文件结构', link: '/zh_CN/docs/dev/file-structure' },
// { text: '关键类说明', link: '/zh_CN/docs/dev/key-classes' },
// { text: '开发规范', link: '/zh_CN/docs/dev/dev-spec' },
// { text: '任务开发步骤', link: '/zh_CN/docs/dev/task-dev' },
// ]
// }
],

socialLinks: [
Expand Down
4 changes: 2 additions & 2 deletions .vitepress/navbar/en_US.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DefaultTheme } from 'vitepress'

export const enNav: DefaultTheme.NavItem[] = [
{ text: 'Home Page', link: '/en_US/' },
{ text: 'Download', link: '/en_US/download/', activeMatch: '/en_US/download/' },
{ text: 'Home Page', link: '/en_US' },
{ text: 'Download', link: '/en_US/download', activeMatch: '/en_US/download' },
]
2 changes: 1 addition & 1 deletion .vitepress/navbar/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { DefaultTheme } from 'vitepress'

export const zhNav: DefaultTheme.NavItem[] = [
{ text: '主页', link: '/zh_CN' },
{ text: '下载', link: '/zh_CN/download/', activeMatch: '/zh_CN/download/' },
{ text: '下载', link: '/zh_CN/download', activeMatch: '/zh_CN/download' },
]
146 changes: 133 additions & 13 deletions .vitepress/theme/components/DownloadLink.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,146 @@
<template>
<div>
<a :href="downloadUrl" target="_blank">镜像 | Mirror</a>
<div>
{{ texts.currentVersion }}<span>{{ version }}</span>
</div>

<details class="details custom-block">
<summary>{{ texts.releaseContent }}</summary>
<div v-html="releaseBody"></div>
</details>

<div>
<div v-if="platform === 'windows'">
<a href="https://github.com/BlueArchiveArisHelper/BAAH/releases" class="VPButton medium brand">{{
texts.githubRelease }}</a>
<a href="https://pan.quark.cn/s/319faf23496c" class="VPButton medium alt">{{ texts.quarkDownload }}</a>
<a href="https://mirrorchyan.com/zh/projects?rid=BAAH" class="VPButton medium alt">{{ texts.mirrorChyanDownload
}}</a>
<a href="https://api.blockhaity.qzz.io/docs/#/api-doc/getbaah" class="VPButton medium alt">{{
texts.blockhaityapi }}</a>
</div>

<div v-else-if="platform === 'mac'">
<a :href="texts.sourceCodePath" class="VPButton medium brand">{{ texts.viewSourceTutorial }}</a>
</div>

<div v-else-if="platform === 'linux'">
<a :href="texts.dockerPath" class="VPButton medium brand">{{ texts.dockerDeploy }}</a>
<a :href="texts.sourceCodePath" class="VPButton medium alt">{{ texts.viewSourceTutorial }}</a>
</div>

<div v-else-if="platform === 'android'">
<a :href="texts.androidPath" class="VPButton medium brand">{{ texts.androidDeployTutorial }}</a>
</div>
</div>
</div>
</template>

<script>
import axios from 'axios';

export default {
name: 'ReleaseInfo',
data() {
return {
downloadUrl: ''
};
version: 'Loading...',
releaseBody: 'Loading...',
platform: '',
error: null,
lang: 'en',
texts: {}
}
},
async mounted() {
try {
const response = await axios.get('https://baah.02000721.xyz/releases');
const data = response.data;
this.downloadUrl = data['assets'][0]['browser_download_url'].replace('https://github.com/BlueArchiveArisHelper/BAAH/releases/', 'https://baah.02000721.xyz/');
} catch (error) {
console.error('Error fetching download link:', error);
created() {
this.detectLanguage()
this.detectPlatform()
this.fetchReleaseInfo()
},
methods: {
detectLanguage() {
const urlPath = window.location.pathname
const browserLang = navigator.language.toLowerCase()
const textDict = {
zh: {
currentVersion: '当前最新版本:',
releaseContent: '发布内容',
quarkDownload: '夸克网盘下载',
mirrorChyanDownload: 'Mirror酱下载(需要CDK)',
githubDirectDownload: 'GitHub直链下载',
githubRelease: 'GitHub Release',
viewSourceTutorial: '查看源码部署教程',
dockerDeploy: 'Docker部署',
androidDeployTutorial: '查看Android部署教程',
loading: '加载中...',
fetchFailed: '获取失败',
blockhaityapi: "BlockHaity's API",
sourceCodePath: '/zh_CN/docs/manual/source-code',
dockerPath: '/zh_CN/docs/manual/quick-start',
androidPath: 'https://bas.blockhaity.qzz.io?target=/2025/02/10/BAAH%E5%9C%A8%E9%80%86%E5%A4%A9%E7%8E%AF%E5%A2%83%E4%B8%8B%E7%9A%84%E8%BF%90%E8%A1%8C/'
},
en: {
currentVersion: 'Current Latest Version: ',
releaseContent: 'Release Content',
quarkDownload: 'Quark Cloud Download',
mirrorChyanDownload: 'MirrorChyan Download (CDK Required)',
githubDirectDownload: 'GitHub Direct Download',
githubRelease: 'GitHub Release',
viewSourceTutorial: 'View Source Deployment Tutorial',
linuxDeployMessage: 'Your OS is Linux, you can use the following deployment methods',
dockerDeploy: 'Docker Deployment',
androidDeployTutorial: 'View Android Deployment Tutorial (Only Chinese)',
loading: 'Loading...',
fetchFailed: 'Failed to fetch',
blockhaityapi: "BlockHaity's API",
sourceCodePath: '/en_US/docs/manual/source-code',
dockerPath: '/en_US/docs/manual/quick-start',
androidPath: 'https://bas.blockhaity.qzz.io?target=/2025/02/10/BAAH%E5%9C%A8%E9%80%86%E5%A4%A9%E7%8E%AF%E5%A2%83%E4%B8%8B%E7%9A%84%E8%BF%90%E8%A1%8C/'
}
}

// 首先检查URL路径中的语言
if (urlPath.includes('/zh_CN/')) {
this.lang = 'zh'
} else if (urlPath.includes('/en_US/')) {
this.lang = 'en'
} else {
// 如果URL中没有语言信息,则使用浏览器语言
if (browserLang.includes('zh')) {
this.lang = 'zh'
} else {
this.lang = 'en'
}
}
this.texts = textDict[this.lang]
this.version = this.texts.loading
this.releaseBody = this.texts.loading
},
detectPlatform() {
const platform = navigator.platform.toLowerCase()
if (platform.includes('win')) {
this.platform = 'windows'
} else if (platform.includes('mac')) {
this.platform = 'mac'
} else if (platform.includes('linux')) {
this.platform = 'linux'
} else if (platform.includes('android')) {
this.platform = 'android'
}
},
async fetchReleaseInfo() {
try {
const response = await fetch('https://api.github.com/repos/BlueArchiveArisHelper/BAAH/releases/latest')
const data = await response.json()
this.version = data.tag_name
this.releaseBody = data.body
.replace(/\n/g, '<br>') // 统一换行符
.replace(/##\s*Fix/g, '<span style="color: #e74c3c; font-weight: bold;">Fix</span>')
.replace(/##\s*Feat/g, '<span style="color: #2ecc71; font-weight: bold;">Feat</span>')
.replace(/##\s*Update/g, '<span style="color: #3498db; font-weight: bold;">Update</span>')
} catch (error) {
console.error('Failed to fetch release info:', error)
this.version = this.texts.fetchFailed
this.releaseBody = this.texts.fetchFailed
}
}
}
};
}
</script>
Loading