From 66c64cd1cda9c6b8fffdb7e415c3afa6f46a91d3 Mon Sep 17 00:00:00 2001 From: James ZHANG <1631685+TheNorthMemory@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E6=95=88=E6=9E=9C=E8=B7=9F=E8=93=9DP=E7=AB=99?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E4=B8=80=E8=87=B4=20(#2857)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config.ts | 93 +++++++++++++++++++++---- docs/.vitepress/theme/styles/layout.css | 61 +++++++++++++++- docs/src/index.md | 17 ++--- 3 files changed, 146 insertions(+), 25 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 373eba66d..5757468c8 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -27,7 +27,11 @@ const nav = [ { text: '赞助', link: 'https://github.com/sponsors/overtrue' - } + }, + { + text: '蓝P站', + link: 'https://wechatpay.im/' + }, ] export const sidebar = versions.reduce( @@ -57,22 +61,24 @@ export default { 'meta', { name: 'twitter:image', - content: 'https://easywechat/logo.png' + content: 'https://easywechat.com/logo.svg' } ], - // google analytics - [ - 'script', - { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-ZVHYZEP1SR' } - ], - [ - 'script', - {}, - `window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - gtag('config', 'G-ZVHYZEP1SR');` - ] + // google analytics, without tracing dev + ...(process?.argv?.[2] === 'dev' ? [] : [ + [ + 'script', + { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-ZVHYZEP1SR' } + ], + [ + 'script', + {}, + `window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'G-ZVHYZEP1SR');` + ], + ]), // end google analytics ], @@ -83,6 +89,45 @@ export default { logo: '/logo-icon.svg', algolia: { + placeholder: '搜索文档', + translations: { + button: { + buttonText: '搜索文档', + buttonAriaLabel: '搜索文档' + }, + modal: { + searchBox: { + resetButtonTitle: '清除查询条件', + resetButtonAriaLabel: '清除查询条件', + cancelButtonText: '取消', + cancelButtonAriaLabel: '取消' + }, + startScreen: { + recentSearchesTitle: '搜索历史', + noRecentSearchesText: '没有搜索历史', + saveRecentSearchButtonTitle: '保存至搜索历史', + removeRecentSearchButtonTitle: '从搜索历史中移除', + favoriteSearchesTitle: '收藏', + removeFavoriteSearchButtonTitle: '从收藏中移除' + }, + errorScreen: { + titleText: '无法获取结果', + helpText: '你可能需要检查你的网络连接' + }, + footer: { + selectText: '选择', + navigateText: '切换', + closeText: '关闭', + searchByText: '搜索提供者' + }, + noResultsScreen: { + noResultsText: '无法找到相关结果', + suggestedQueryText: '你可以尝试查询', + reportMissingResultsText: '你认为该查询应该有结果?', + reportMissingResultsLinkText: '点击反馈' + }, + }, + }, indexName: 'easywechat', appId: 'X3KJL5SQXD', apiKey: '5c5ba71b35c48411f245bef4c695fc36' @@ -91,6 +136,24 @@ export default { // } }, + returnToTopLabel: '回到顶部', + sidebarMenuLabel: '菜单', + darkModeSwitchLabel: '主题模式', + lightModeSwitchTitle: '浅色模式', + darkModeSwitchTitle: '深色模式', + + docFooter: { + prev: '上一页', + next: '下一页' + }, + + notFound: { + title: '未找到', + quote: '您所访问的页面未找到,或者已失效', + linkLabel: '返回首页', + linkText: '返回首页', + }, + // carbonAds: { // code: '', // placement: '' diff --git a/docs/.vitepress/theme/styles/layout.css b/docs/.vitepress/theme/styles/layout.css index 4bb42fb25..6b83feb2b 100644 --- a/docs/.vitepress/theme/styles/layout.css +++ b/docs/.vitepress/theme/styles/layout.css @@ -1,7 +1,64 @@ .VPContent, .VPContent .VPContentPage, .VPContent .VPContentPage main, -.VPContent .VPContentPage main > div, -.VPContent .VPContentPage main > div > div { +.VPContent .VPContentPage main>div, +.VPContent .VPContentPage main>div>div { @apply flex-1 flex flex-col; } + +.dark .im-home { + --im-gradient-p1: #8356dc; + --im-gradient-p3: #5908a6; + --im-gradient-p2: #044f1e; + --im-gradient-p4: #49bcb7; +} + +.im-home { + --im-gradient-p1: #ecd8ff; + --im-gradient-p2: #e8fca7; + --im-gradient-p3: #dafbe1; + --im-gradient-p4: #ffd8b5; + background: linear-gradient(-40deg, var(--im-gradient-p1), var(--im-gradient-p2), var(--im-gradient-p3), var(--im-gradient-p4)); + background-size: 120% 120%; +} + +.im-home .top { + --vp-nav-bg-color: transparent; + --vp-c-bg: transparent; + --vp-c-gutter: transparent; + --vp-c-bg-alt: transparent; + --vp-c-divider: transparent; +} + +.im-home .VPContent { + justify-content: center; +} + +.im-home .bash-composer:before { + content: "$"; + letter-spacing: .35rem; + opacity: 1; + animation: im-blink 1s ease infinite; +} + +@keyframes im-blink { + 0% { + opacity: 1; + } + + 50% { + opacity: 0; + } + + 100% { + opacity: 8; + } +} + +.im-home .border-t { + border-top-color: transparent; +} + +.dark .im-home .dark\:border-black { + --tw-border-opacity: 0; +} \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index 95070d3c0..4b1385e8e 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,5 +1,6 @@ --- layout: page +pageClass: im-home title: EasyWeChat - 一个 PHP 微信开发 SDK --- @@ -15,12 +16,12 @@ let latestVersion = versions[0]

微信开发,可以更简单

-

+

每一个细节,都经过精心打磨,只为了提供更好的开发体验。

overtrue
-
+
overtrue
核心开发者
@@ -78,14 +79,14 @@ let latestVersion = versions[0]
overtrue
-
+
微擎
开源 Saas 平台提供商