From 1ac1bb94e7e82a1b7f86544c7667ecc4298164f1 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 10 Jul 2022 21:20:32 +0800 Subject: [PATCH] feat(cli): support site.headHtml option (#10807) * feat(cli): support site.headHtml option * docs: update * docs: update --- packages/vant-cli/docs/config.md | 9 ++++++++- packages/vant-cli/docs/config.zh-CN.md | 9 ++++++++- packages/vant-cli/site/index.html | 3 +++ packages/vant-cli/site/mobile.html | 3 +++ packages/vant-cli/src/config/vite.site.ts | 2 ++ packages/vant/vant.config.mjs | 8 +++++++- 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/packages/vant-cli/docs/config.md b/packages/vant-cli/docs/config.md index 47de3e1c3..047161d21 100644 --- a/packages/vant-cli/docs/config.md +++ b/packages/vant-cli/docs/config.md @@ -380,12 +380,19 @@ Customize iframe URL. Customize HTML meta tag, key means name, value means content. +### site.headHtml + +- Type: `string` +- Default: `undefined` + +Insert a custom HTML content in the `` tag. + ### site.enableVConsole - Type: `boolean` - Default: `false` -Should use [vConsole](https://github.com/Tencent/vConsole) to debug when dev. For mobile. +Whether to enable [vConsole](https://github.com/Tencent/vConsole) debugging in dev, usually used for mobile debugging. ## PostCSS diff --git a/packages/vant-cli/docs/config.zh-CN.md b/packages/vant-cli/docs/config.zh-CN.md index 19a74be15..c1e01715c 100644 --- a/packages/vant-cli/docs/config.zh-CN.md +++ b/packages/vant-cli/docs/config.zh-CN.md @@ -337,7 +337,7 @@ module.exports = { ### site.baiduAnalytics - Type: `object` -- Default: `undefied` +- Default: `undefined` 文档网站的百度统计配置,添加这项配置后,会自动在构建文档网站时加载百度统计的脚本。 @@ -384,6 +384,13 @@ module.exports = { 配置 HTML 中的 meta 标签,对象的 key 为 name,value 为 content。 +### site.headHtml + +- Type: `string` +- Default: `undefined` + +在 `` 标签中插入一段自定义的 HTML 内容。 + ### site.enableVConsole - Type: `boolean` diff --git a/packages/vant-cli/site/index.html b/packages/vant-cli/site/index.html index eba05322b..98a063899 100644 --- a/packages/vant-cli/site/index.html +++ b/packages/vant-cli/site/index.html @@ -15,6 +15,9 @@ + <% if (headHtml) { %> + <%- headHtml %> + <% } %> <% if (baiduAnalytics) { %> +`, locales: { 'zh-CN': { title: 'Vant 3',