Skip to content

🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.

feat(site): 中文首页的微信分享卡片改用方图和短文案

dyk98aa2d5ebf4800
diff --git a/site/public/og/wechat-home.png b/site/public/og/wechat-home.png
new file mode 100644
index 0000000..bf72cd8
Binary files /dev/null and b/site/public/og/wechat-home.png differ
diff --git a/site/scripts/make-og.py b/site/scripts/make-og.py
index 5472e03..e35127d 100644
--- a/site/scripts/make-og.py
+++ b/site/scripts/make-og.py
@@ -1,5 +1,6 @@
# 生成静态图形资源:favicon / App 图标(Eyes 标记,静态居中)与 OG 分享图(zh / en,1200×630)。
# 产物提交到 public/;改了文案或标记后手动运行:python3 scripts/make-og.py(需要 Pillow 与 Noto Sans SC)。
+# 中文首页的微信分享方图单独生成:python3 scripts/make-og.py wechat-home
import os
import sys
from PIL import Image, ImageDraw, ImageFilter, ImageFont
@@ -138,7 +139,24 @@ def og(lang):
print(out, os.path.getsize(out) // 1024, "KB")
+def wechat_home():
+ """中文首页的微信分享方图(600×600):版式同 og/wechat-share.png,字够大,缩到聊天里的小方格也看得清"""
+ S = 1200 # 先画两倍再缩小,字的边缘更干净
+ im = Image.new("RGBA", (S, S), BG + (255,))
+ m = mark(480)
+ im.alpha_composite(m, ((S - m.width) // 2, 122))
+ d = ImageDraw.Draw(im)
+ d.text((S / 2, 660), "你的 AI 搭子", font=font(CJK, 180, 800), fill=TEXT, anchor="ma")
+ d.text((S / 2, 940), "AnyModelBot", font=font(CJK, 96, 700), fill=LIME, anchor="ma")
+ out = os.path.join(PUB, "og", "wechat-home.png")
+ im.resize((600, 600), Image.LANCZOS).convert("RGB").save(out, optimize=True)
+ print(out, os.path.getsize(out) // 1024, "KB")
+
+
if __name__ == "__main__":
+ if sys.argv[1:] == ["wechat-home"]:
+ wechat_home()
+ sys.exit(0)
# Specify languages to regenerate only those sharing cards, leaving icons intact.
selected = sys.argv[1:] or list(COPY)
if not sys.argv[1:]:
diff --git a/site/src/layouts/Base.astro b/site/src/layouts/Base.astro
index 2d71884..4bd01a3 100644
--- a/site/src/layouts/Base.astro
+++ b/site/src/layouts/Base.astro
@@ -19,15 +19,20 @@ interface Props {
description?: string;
jsonLd?: object[];
noindex?: boolean;
+ /** 分享卡片的标题和描述,不传就用 title、description。卡片文案要和搜索结果不一样时才传 */
+ ogTitle?: string;
+ ogDescription?: string;
/** 分享图,url 写完整地址。不传就用当前语言的默认图(1200×630) */
ogImage?: { url: string; width: number; height: number };
/** 方图要配 summary,默认的大图卡片会把它裁掉一截 */
twitterCard?: "summary" | "summary_large_image";
}
-const { lang, path, title, description, jsonLd = [], noindex = false, ogImage, twitterCard = "summary_large_image" } = Astro.props;
+const { lang, path, title, description, jsonLd = [], noindex = false, ogTitle, ogDescription, ogImage, twitterCard = "summary_large_image" } = Astro.props;
const t = dict(lang);
const pageTitle = title ?? t.meta.title;
const desc = description ?? t.meta.description;
+const cardTitle = ogTitle ?? pageTitle;
+const cardDesc = ogDescription ?? desc;
const canonical = `${ORIGIN}${href(lang, path)}`;
const og = ogImage ?? { url: `${ORIGIN}${t.meta.ogImage}`, width: 1200, height: 630 };
const dlData = {
@@ -57,8 +62,8 @@ const dlData = {
{!noindex && <link rel="alternate" hreflang="x-default" href={`${ORIGIN}${href("zh", path)}`} />}
<meta property="og:type" content="website" />
<meta property="og:site_name" content="AnyModelBot" />
- <meta property="og:title" content={pageTitle} />
- <meta property="og:description" content={desc} />
+ <meta property="og:title" content={cardTitle} />
+ <meta property="og:description" content={cardDesc} />
<meta property="og:url" content={canonical} />
<meta property="og:image" content={og.url} />
<meta property="og:image:width" content={String(og.width)} />
@@ -66,8 +71,8 @@ const dlData = {
<meta property="og:locale" content={LOCALES[lang].og} />
{READY_LANGS.filter((l) => l !== lang).map((l) => <meta property="og:locale:alternate" content={LOCALES[l].og} />)}
<meta name="twitter:card" content={twitterCard} />
- <meta name="twitter:title" content={pageTitle} />
- <meta name="twitter:description" content={desc} />
+ <meta name="twitter:title" content={cardTitle} />
+ <meta name="twitter:description" content={cardDesc} />
<meta name="twitter:image" content={og.url} />
<meta name="theme-color" content="#060706" data-theme-color />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
diff --git a/site/src/views/Home.astro b/site/src/views/Home.astro
index 8273ff5..9d951a2 100644
--- a/site/src/views/Home.astro
+++ b/site/src/views/Home.astro
@@ -14,12 +14,15 @@ import Final from "../sections/Final.astro";
import DemoTour from "../components/DemoTour.astro";
import { dict, type Lang } from "../i18n";
import { homeJsonLd } from "../lib/seo";
+import { ORIGIN } from "../lib/site";
import "../styles/home.css";
import "../styles/sections.css";
interface Props { lang: Lang }
const { lang } = Astro.props;
+// 微信分享卡片:短文案和方图只给中文首页。<title> 和 description 带搜索关键词,不动
+const share = lang === "zh" ? { ogTitle: "AnyModelBot|你的 AI 搭子,住在你的电脑里", ogDescription: "整理文件、跑命令、记住你的习惯,一个 Key 用上主流模型。", ogImage: { url: `${ORIGIN}/og/wechat-home.png`, width: 600, height: 600 }, twitterCard: "summary" as const } : {};
---
-<Base lang={lang} path="/" jsonLd={homeJsonLd(lang)}>
+<Base lang={lang} path="/" jsonLd={homeJsonLd(lang)} {...share}>
<Hero lang={lang} />
<Bots lang={lang} />
<CatalogStrip lang={lang} />