fix(portal): 官方文档导航直接跳文档站,不再停在本站锚点
mirror-to-gitee / mirror (push) Successful in 3s

原先导航「官方文档」指向 /#docs(首页内的文档区块),
用户期望点它直接进 http://open.5iot.com:5051/docs/。

改动
- 导航项改为外链 http://open.5iot.com:5051/docs/,
  带 target=_blank 与 rel=noopener,新开标签页不打断阅读
- 首页 hero 的「官方文档」按钮同样改为外链直跳
- 文档站地址收敛为单一来源:data/content.ts 导出 DOCS_BASE / DOCS_HOME,
  可用环境变量 DOCS_BASE 覆盖;config.mts 与 HomePage.vue 都引用它,
  消除原先三处硬编码
- 首页的「官方文档」区块(#docs)保留,仍是各手册入口的聚合卡片

验证
- 导航渲染实测:href=http://open.5iot.com:5051/docs/, target=_blank
- 点击实测:新开标签页到目标地址,原页面 URL 不变
- 锚点项高亮不受影响(点「产品功能」仍正常变蓝)
- 构建 13 页 262 引用 0 失效
This commit is contained in:
Dai0814
2026-11-04 15:36:04 +08:00
parent 39209ef591
commit 6944652966
9 changed files with 195 additions and 21 deletions
+11 -5
View File
@@ -6,6 +6,7 @@ import {
productLines,
coreAbilities,
docs,
DOCS_HOME,
} from '../../../data/content'
</script>
@@ -14,10 +15,10 @@ import {
<!-- Hero -->
<section class="p-hero">
<div class="p-wrap">
<span class="p-eyebrow">APACHE-2.0 · 开源项目门户</span>
<h1 class="p-hero-title">物联网与中后台<em>基础软件</em></h1>
<span class="p-eyebrow">APACHE-2.0 · 开源运营平台</span>
<h1 class="p-hero-title">雪羊科技物联网<em>卡与设备</em>管理平台</h1>
<p class="p-hero-sub">
雪羊科技对外开源的项目集合。物联网卡管理、DTU 设备管理、中后台开发底座,
我们对外开源的项目集合。物联网卡管理、DTU 设备管理、中后台开发底座,
同一套工程规范,同一个许可证,clone 之后就能跑起来。
</p>
<div class="p-hero-actions">
@@ -27,7 +28,12 @@ import {
<path d="M3 8h10M9 4l4 4-4 4" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</a>
<a class="p-btn p-btn--ghost" href="#docs">官方文档</a>
<a
class="p-btn p-btn--ghost"
:href="DOCS_HOME"
target="_blank"
rel="noopener"
>官方文档</a>
</div>
<div class="p-stats">
@@ -214,7 +220,7 @@ import {
</div>
<p class="doc-note">
文档站地址:<a :href="'http://open.5iot.com:5051/docs/'" target="_blank" rel="noopener">http://open.5iot.com:5051/docs/</a>
文档站地址:<a :href="DOCS_HOME" target="_blank" rel="noopener">{{ DOCS_HOME }}</a>
</p>
</div>
</section>