diff --git a/.gitignore b/.gitignore index 340b3f6..a53ea7f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,7 @@ dist/ # 编辑器 .vscode/ .idea/ + +# SSH 密钥(严禁入库) +repo +repo.pub diff --git a/deploy/artalk/artalk.yml b/deploy/artalk/artalk.yml new file mode 100644 index 0000000..20b838b --- /dev/null +++ b/deploy/artalk/artalk.yml @@ -0,0 +1,160 @@ +# Artalk 配置 · Yukun's Blog +# 基于官方 conf/artalk.example.zh-CN.yml 裁剪 +# 文档:https://artalk.js.org +# +# ★ 部署前必改: +# 1. app_key → 执行 `openssl rand -hex 16` 生成随机字符串填入(加密密钥,勿泄露) +# 2. admin_users → 可留空,启动后 `docker exec -it artalk artalk admin` 交互创建 +# 3. site_url → 确认主站域名 +# ---------------------------------------------------------------------- + +# 服务器 +host: "0.0.0.0" +port: 23366 +# ★ 加密密钥(务必生成随机值,openssl rand -hex 16) +app_key: "" +debug: false +locale: zh-CN +timezone: Asia/Shanghai + +# 站点 +site_default: "Yukun's Blog" +# ★ 备案期间用 IP 预览地址;备案完成后改回 https://sausagetoast.cloud +site_url: "http://106.54.37.223:8321" +login_timeout: 259200 + +# 数据库(SQLite 开箱即用,数据落地 ./data/artalk.db) +db: + type: sqlite + file: ./data/artalk.db + prepare_stmt: true + +# 日志 +log: + enabled: true + filename: ./data/artalk.log + +# HTTP +http: + body_limit: 100 + # 走 nginx 反代时填 X-Forwarded-For 获取真实 IP + proxy_header: "X-Forwarded-For" + +# ★ 可信域名(CORS 防护:前端页面所在来源都要填) +trusted_domains: + - "https://sausagetoast.cloud" + - "http://localhost:4321" + - "http://106.54.37.223:8321" # 备案期间的主站预览地址(备案完成后可删) + +# 管理员账户(留空,启动后用命令创建:docker exec -it artalk artalk admin) +admin_users: [] + +# ★ 审核与反垃圾(匿名方案必备) +moderator: + # 新评论默认直接显示(低流量博客可接受;想严格审核改 true) + pending_default: false + # 反垃圾 API 出错时是否拦截(false = 出错放行,避免误伤) + api_fail_block: false + # Akismet 反垃圾(可选,https://akismet.com 申请 key) + akismet_key: "" + # 腾讯云/阿里云内容安全(可选,留默认关闭) + tencent: + enabled: false + aliyun: + enabled: false + # ★ 本地关键词过滤(离线词库,零成本防垃圾) + keywords: + enabled: true + pending: true # 命中关键词 → 设为待审 + files: + - ./data/keywords.txt + file_sep: "\n" + replace_to: "*" + +# ★ 验证码(匿名评论防垃圾主力) +captcha: + enabled: true + always: false # 操作 3 次后才要求验证码(降低打扰) + captcha_type: image # 图形验证码,零第三方依赖 + action_limit: 3 + action_reset: 60 + +# IP 属地展示(可选,默认关闭) +ip_region: + enabled: false + db_path: ./data/ip2region.xdb + precision: province + +# 图片上传 +img_upload: + enabled: true + path: ./data/artalk-img/ + max_size: 5 + public_path: null + +# ★ 邮件通知(国内服务器不部署 SMTP,关闭) +email: + enabled: false + +# ★ 管理员通知(无 SMTP,邮件通知关闭;如需可开 Telegram/Bark 等推送) +admin_notify: + notify_pending: false + noise_mode: false + email: + enabled: false + telegram: + enabled: false + api_token: "" + receivers: [] + bark: + enabled: false + server: "" + webhook: + enabled: false + url: "" + +# ★ 身份认证(匿名方案:允许仅填昵称+邮箱评论) +auth: + enabled: true + # 允许匿名评论(跳过验证,仅填昵称+邮箱) + anonymous: true + # 邮箱验证码登录(无 SMTP 无法发验证码,关闭) + email: + enabled: false + # 社交登录默认全部关闭;需要时参考官方文档逐项开启 + github: + enabled: false + google: + enabled: false + +# 界面默认配置(前端 Comments.astro 也会覆盖部分项) +frontend: + placeholder: "喵~说点什么吧(昵称 + 邮箱即可评论)" + noComment: "快来抢沙发喵~" + sendBtn: "发送" + editorTravel: true + emoticons: https://cdn.jsdelivr.net/gh/ArtalkJS/Emoticons/grps/default.json + vote: true + voteDown: false + uaBadge: false + listSort: true + preview: true + flatMode: auto + nestMax: 2 + nestSort: DATE_ASC + darkMode: inherit + gravatar: + mirror: https://weavatar.com/avatar/ + params: sha256=1&d=mp&s=240 + pagination: + pageSize: 20 + readMore: true + autoLoad: true + heightLimit: + content: 300 + children: 400 + scrollable: false + imgLazyLoad: false + reqTimeout: 15000 + versionCheck: true + pluginURLs: [] diff --git a/deploy/artalk/docker-compose.yml b/deploy/artalk/docker-compose.yml new file mode 100644 index 0000000..b81bf93 --- /dev/null +++ b/deploy/artalk/docker-compose.yml @@ -0,0 +1,19 @@ +# Artalk 评论后端 · Docker Compose +# 部署位置:VPS /opt/artalk/ (与此文件同目录需有 artalk.yml 和 ./data/) +# 启动:docker compose up -d +# 反代:./deploy/proxy.sh comments 8080 → https://comments.sausagetoast.cloud +services: + artalk: + container_name: artalk + image: artalk/artalk-go:latest + restart: unless-stopped + # ★ 备案期间:监听所有网卡,前端直接 http://<服务器IP>:8080 访问(无需子域名) + # 需在云服务器安全组/防火墙放行 TCP 8080 + # 备案完成改用子域名反代(deploy/proxy.sh)后,建议改回 "127.0.0.1:8080:23366" 更安全 + ports: + - "8080:23366" + volumes: + - ./data:/data # SQLite 数据库 + 图片 + 日志 + - ./artalk.yml:/data/artalk.yml:ro # 配置文件(只读挂载) + environment: + - TZ=Asia/Shanghai diff --git a/public/beian-mps.png b/public/beian-mps.png new file mode 100644 index 0000000..2a13ba2 Binary files /dev/null and b/public/beian-mps.png differ diff --git a/public/images/LLM-structure.jpg b/public/images/LLM-structure.jpg new file mode 100644 index 0000000..2fe5a6b Binary files /dev/null and b/public/images/LLM-structure.jpg differ diff --git a/public/images/logo.png b/public/images/logo.png new file mode 100644 index 0000000..14d8301 Binary files /dev/null and b/public/images/logo.png differ diff --git a/public/images/moe_routing.png b/public/images/moe_routing.png new file mode 100644 index 0000000..5b17d8d Binary files /dev/null and b/public/images/moe_routing.png differ diff --git a/public/images/rope_freqs.png b/public/images/rope_freqs.png new file mode 100644 index 0000000..8efd1ab Binary files /dev/null and b/public/images/rope_freqs.png differ diff --git a/public/images/rope_position_signal.png b/public/images/rope_position_signal.png new file mode 100644 index 0000000..8e0e07a Binary files /dev/null and b/public/images/rope_position_signal.png differ diff --git a/public/images/rope_relative.png b/public/images/rope_relative.png new file mode 100644 index 0000000..e4397a5 Binary files /dev/null and b/public/images/rope_relative.png differ diff --git a/public/images/yarn_ramp.png b/public/images/yarn_ramp.png new file mode 100644 index 0000000..6ea9cb2 Binary files /dev/null and b/public/images/yarn_ramp.png differ diff --git a/src/components/Background.astro b/src/components/Background.astro deleted file mode 100644 index 180924e..0000000 --- a/src/components/Background.astro +++ /dev/null @@ -1,8 +0,0 @@ ---- -// 固定背景层:渐变底 + 漂浮光斑 + 极淡网格 ---- - diff --git a/src/components/Comments.astro b/src/components/Comments.astro new file mode 100644 index 0000000..79cd3fb --- /dev/null +++ b/src/components/Comments.astro @@ -0,0 +1,239 @@ +--- +// 评论区组件 · 自托管 Artalk +// 部署:VPS 跑 artalk/artalk-go 容器 + ./deploy/proxy.sh comments 8080 +// 备案期间 comments.sausagetoast.cloud 可能不通,组件会静默降级(不破坏页面) +interface Props { + /** 页面标识,文章用 /posts/,需与路由生成的 URL 一致 */ + pageKey: string; + /** 页面标题,用于后台展示与通知 */ + pageTitle: string; +} +const { pageKey, pageTitle } = Astro.props; + +// 评论后端服务地址(构建期注入,SSG 会烤进 HTML) +// - 备案期间 IP 直连:PUBLIC_ARTALK_SERVER=http://<服务器IP>:8080 npm run build +// (deploy/ip-preview.sh 检测到 REMOTE_HOST 是 IP 时会自动注入) +// - 备案完成走子域名反代:不设置,使用下面的默认值 +// - 本地联调:PUBLIC_ARTALK_SERVER=http://localhost:8080 npm run dev +// (并在 artalk.yml 的 trusted_domains 放行对应来源) +const SERVER = + import.meta.env.PUBLIC_ARTALK_SERVER?.replace(/\/+$/, '') || + 'https://comments.sausagetoast.cloud'; +const SITE = "Yukun's Blog"; +--- + +
+

+ 评论 +

+ +
+
+ + 评论加载中… +
+
+ + +
+ + + + diff --git a/src/components/Footer.astro b/src/components/Footer.astro index a8094c9..7e822fe 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -6,103 +6,112 @@ const range = year - startYear; diff --git a/src/components/Nav.astro b/src/components/Nav.astro index 5166bfc..6abd6d0 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -11,19 +11,16 @@ const path = Astro.url.pathname.replace(/\/+$/, '').replace(/^\//, ''); const current = path === '' ? 'index' : path.split('/')[0]; --- -
-
+
@@ -56,7 +58,7 @@ const updated = post.data.updatedDate ? formatDate(post.data.updatedDate) : null #{t} ))}
- ← 返回首页 + ← 返回首页
@@ -73,13 +75,13 @@ const updated = post.data.updatedDate ? formatDate(post.data.updatedDate) : null {(prev || next) && (