From dd6a84f2c2b4306c8f2f59edff29a36bb9498a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=8F=89=E6=A0=91=E6=A0=91?= Date: Sat, 29 Nov 2025 07:40:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=85=8D=E7=BD=AE):=20=E5=B0=86?= =?UTF-8?q?=E9=87=8D=E5=AE=9A=E5=90=91=E8=A7=84=E5=88=99=E4=BB=8Evercel?= =?UTF-8?q?=E5=92=8Cedgeone=E8=BF=81=E7=A7=BB=E8=87=B3astro=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将原本分散在vercel.json和edgeone.json中的重定向规则统一迁移到astro.config.mjs中,简化配置管理 --- astro.config.mjs | 13 ++++- edgeone.json | 59 +---------------------- src/components/widget/SideBar.astro | 74 ++++++++++++++--------------- vercel.json | 57 ---------------------- 4 files changed, 49 insertions(+), 154 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 4ee069f31..71e5e3552 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -39,7 +39,16 @@ export default defineConfig({ output: "static", redirects: { "/donate": "/sponsors", - "/donate/": "/sponsors/" + "/ak": "https://akile.io/register?aff_code=503fe5ea-e7c5-4d68-ae05-6de99513680e", + "/kook": "https://kook.vip/K29zpT", + "/long": "https://iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.in/", + "/mly": "https://muleyun.com/aff/GOTRJLPN", + "/tg": "https://t.me/+_07DERp7k1ljYTc1", + "/tit": "/posts/pin/", + "/tly": "https://tianlicloud.cn/aff/HNNCFKGP", + "/wly": "https://wl.awcmam.com/#/register?code=FNQwOQBM", + "/yyb": "https://www.rainyun.com/acofork_?s=bilibili", + "/iku": "https://ikuuu.de/auth/register?code=Bjou" }, integrations: [tailwind({ nesting: true, @@ -184,4 +193,4 @@ export default defineConfig({ }, }, }, -}); +}); \ No newline at end of file diff --git a/edgeone.json b/edgeone.json index f7fa0588d..2c63c0851 100644 --- a/edgeone.json +++ b/edgeone.json @@ -1,59 +1,2 @@ { - "redirects": [ - { - "source": "/ak", - "destination": "https://akile.io/register?aff_code=503fe5ea-e7c5-4d68-ae05-6de99513680e", - "statusCode": 302 - }, - { - "source": "/kook", - "destination": "https://kook.vip/K29zpT", - "statusCode": 302 - }, - { - "source": "/long", - "destination": "https://iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.in/", - "statusCode": 302 - }, - { - "source": "/mly", - "destination": "https://muleyun.com/aff/GOTRJLPN", - "statusCode": 302 - }, - { - "source": "/tg", - "destination": "https://t.me/+_07DERp7k1ljYTc1", - "statusCode": 302 - }, - { - "source": "/tit", - "destination": "/posts/pin/", - "statusCode": 302 - }, - { - "source": "/tly", - "destination": "https://tianlicloud.cn/aff/HNNCFKGP", - "statusCode": 302 - }, - { - "source": "/wly", - "destination": "https://wl.awcmam.com/#/register?code=FNQwOQBM", - "statusCode": 302 - }, - { - "source": "/yyb", - "destination": "https://www.rainyun.com/acofork_?s=bilibili", - "statusCode": 302 - }, - { - "source": "/iku", - "destination": "https://ikuuu.de/auth/register?code=Bjou", - "statusCode": 302 - }, - { - "source": "/donate", - "destination": "/sponsors", - "statusCode": 302 - } - ] -} \ No newline at end of file +} diff --git a/src/components/widget/SideBar.astro b/src/components/widget/SideBar.astro index 45633dad0..fb3d343df 100644 --- a/src/components/widget/SideBar.astro +++ b/src/components/widget/SideBar.astro @@ -1,37 +1,37 @@ ---- -import type { MarkdownHeading } from "astro"; - -import Profile from "./Profile.astro"; -import Tag from "./Tags.astro"; -import DomainSwitcher from "./DomainSwitcher.astro"; - -interface Props { - class?: string; - headings?: MarkdownHeading[]; -} - -const className = Astro.props.class; ---- - - \ No newline at end of file +--- +import type { MarkdownHeading } from "astro"; + +import Profile from "./Profile.astro"; +import Tag from "./Tags.astro"; +import DomainSwitcher from "./DomainSwitcher.astro"; + +interface Props { + class?: string; + headings?: MarkdownHeading[]; +} + +const className = Astro.props.class; +--- + + diff --git a/vercel.json b/vercel.json index dd9a7845c..2c63c0851 100644 --- a/vercel.json +++ b/vercel.json @@ -1,59 +1,2 @@ { - "redirects": [ - { - "source": "/ak", - "destination": "https://akile.io/register?aff_code=503fe5ea-e7c5-4d68-ae05-6de99513680e", - "permanent": false - }, - { - "source": "/kook", - "destination": "https://kook.vip/K29zpT", - "permanent": false - }, - { - "source": "/long", - "destination": "https://iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.in/", - "permanent": false - }, - { - "source": "/mly", - "destination": "https://muleyun.com/aff/GOTRJLPN", - "permanent": false - }, - { - "source": "/tg", - "destination": "https://t.me/+_07DERp7k1ljYTc1", - "permanent": false - }, - { - "source": "/tit", - "destination": "/posts/pin/", - "permanent": false - }, - { - "source": "/tly", - "destination": "https://tianlicloud.cn/aff/HNNCFKGP", - "permanent": false - }, - { - "source": "/wly", - "destination": "https://wl.awcmam.com/#/register?code=FNQwOQBM", - "permanent": false - }, - { - "source": "/yyb", - "destination": "https://www.rainyun.com/acofork_?s=bilibili", - "permanent": false - }, - { - "source": "/iku", - "destination": "https://ikuuu.de/auth/register?code=Bjou", - "permanent": false - }, - { - "source": "/donate", - "destination": "/sponsors", - "permanent": false - } - ] }