Skip to content

Commit bf61a5c

Browse files
committed
fix(docs-site): use withBase() for public asset refs in Vue components
Rollup treats hardcoded /sap-devs-cli/*.png paths as module imports during SSR build, causing the build to fail. Using VitePress's withBase() defers path resolution to runtime.
1 parent 9a6418e commit bf61a5c

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

docs-site/.vitepress/theme/components/FioriHome.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import { withBase } from 'vitepress'
3+
24
const features = [
35
{ icon: 'sap-icon--action-settings', title: 'Inject', desc: 'Push SAP context into Claude, Cursor, Copilot', link: '/sap-devs-cli/guide/user-guide' },
46
{ icon: 'sap-icon--connected', title: 'MCP Server', desc: '31 live tools for AI agents', link: '/sap-devs-cli/developer/mcp-server' },
@@ -23,7 +25,7 @@ const features = [
2325
</div>
2426
</div>
2527
<div class="hero__logo">
26-
<img src="/sap-devs-cli/mascot.png" alt="sap-devs mascot" class="hero__mascot" />
28+
<img :src="withBase('/mascot.png')" alt="sap-devs mascot" class="hero__mascot" />
2729
</div>
2830
</div>
2931
</section>

docs-site/.vitepress/theme/components/FioriShellbar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { useData } from 'vitepress'
2+
import { useData, withBase } from 'vitepress'
33
44
declare const __APP_VERSION__: string
55
@@ -21,9 +21,9 @@ function openSearch() {
2121
<template>
2222
<div class="fd-shellbar" role="banner">
2323
<div class="fd-shellbar__group fd-shellbar__group--product">
24-
<a href="/sap-devs-cli/" class="fd-shellbar__branding" aria-label="Home">
24+
<a :href="withBase('/')" class="fd-shellbar__branding" aria-label="Home">
2525
<span class="fd-shellbar__logo">
26-
<img src="/sap-devs-cli/favicon.png" alt="sap-devs" width="24" height="24" />
26+
<img :src="withBase('/favicon.png')" alt="sap-devs" width="24" height="24" />
2727
</span>
2828
<span class="fd-shellbar__title">sap-devs</span>
2929
</a>

0 commit comments

Comments
 (0)