From 6725a02592485e2f85b930c79937ec19caaa9ccc Mon Sep 17 00:00:00 2001 From: yukun-hh Date: Thu, 27 Aug 2026 22:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8D=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/ip-preview.sh | 13 ++++++++++-- src/components/Footer.astro | 39 +++++++++++++++++++++++++++++++++++- src/pages/about.astro | 4 ++-- src/pages/posts/[slug].astro | 4 ++++ src/remark-wikilinks.mjs | 35 +++++++++++++++++++++++++------- 5 files changed, 83 insertions(+), 12 deletions(-) diff --git a/deploy/ip-preview.sh b/deploy/ip-preview.sh index 8083c6c..8ea72d8 100755 --- a/deploy/ip-preview.sh +++ b/deploy/ip-preview.sh @@ -10,7 +10,7 @@ set -euo pipefail # ====== 配置区(与 deploy.sh 保持一致,ssh 不通时 REMOTE_HOST 填服务器 IP) ====== REMOTE_USER="root" # SSH 用户(服务器是 ubuntu 用户的话改成 ubuntu) -REMOTE_HOST="sausagetoast.cloud" # VPS 地址(备案期间建议填服务器 IP) +REMOTE_HOST="106.54.37.223" # VPS 地址(备案期间用 IP;备案完成后改回 sausagetoast.cloud) REMOTE_DIR="/var/www/yukun" # 博客站点根目录 # ============================================================================== @@ -20,6 +20,15 @@ SSH_OPTS="-o StrictHostKeyChecking=accept-new" echo "==> [1/3] 构建站点 (astro build)..." cd "$ROOT_DIR" + +# 备案期间评论区用 IP 直连(无需子域名): +# REMOTE_HOST 是 IPv4 时自动注入评论后端地址 http://:8080 +# 如需自定义(比如端口不同),可提前手动 export PUBLIC_ARTALK_SERVER 覆盖 +if [[ "$REMOTE_HOST" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] && [ -z "${PUBLIC_ARTALK_SERVER:-}" ]; then + export PUBLIC_ARTALK_SERVER="http://${REMOTE_HOST}:8080" + echo " 评论服务地址: ${PUBLIC_ARTALK_SERVER} (deploy/artalk/)" +fi + npm run build [ -d "$ROOT_DIR/dist" ] || { echo "✗ 构建失败:dist 不存在"; exit 1; } @@ -94,5 +103,5 @@ $SUDO systemctl reload nginx || $SUDO systemctl restart nginx REMOTE echo "" -echo "✓ 完成!访问 http://<服务器IP>:8321" +echo "✓ 完成!访问 http://${REMOTE_HOST}:8321" echo " 备案完成后:ssh 到服务器执行 sudo rm /etc/nginx/conf.d/ip-preview.conf && sudo systemctl reload nginx 即可移除" diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 7f97fc3..a8094c9 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -22,7 +22,24 @@ const range = year - startYear; 关于 @@ -65,6 +82,26 @@ const range = year - startYear; color: var(--ink-faint); font-size: 0.82rem; } + .footer-meta { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 6px 14px; + } + .footer-icp { + color: var(--ink-faint); + font-size: 0.82rem; + transition: color .2s; + display: inline-flex; + align-items: center; + gap: 4px; + } + .footer-icp:hover { color: var(--blue-600); } + .beian-icon { + width: 14px; + height: 16px; + vertical-align: -3px; + } @media (max-width: 768px) { .footer-nav { gap: 6px 14px; } } diff --git a/src/pages/about.astro b/src/pages/about.astro index b162285..b86ffae 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -20,9 +20,9 @@ import BaseLayout from '../layouts/BaseLayout.astro'; sausagetoast.cloud - + - 给我写信(Google) + 给我写信(学校) diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro index 9bb350a..7c2d64d 100644 --- a/src/pages/posts/[slug].astro +++ b/src/pages/posts/[slug].astro @@ -3,6 +3,7 @@ import { render } from 'astro:content'; import BaseLayout from '../../layouts/BaseLayout.astro'; import { getPublishedPosts, formatDate, readingTime, heroCss } from '../../lib/utils'; import Toc from '../../components/Toc.astro'; +import Comments from '../../components/Comments.astro'; import '../../styles/prose.css'; export async function getStaticPaths() { @@ -65,6 +66,9 @@ const updated = post.data.updatedDate ? formatDate(post.data.updatedDate) : null + + + {(prev || next) && (