diff --git a/docs/content/docs/guide/configuration.ja.md b/docs/content/docs/guide/configuration.ja.md index c2136c4..6a067ed 100644 --- a/docs/content/docs/guide/configuration.ja.md +++ b/docs/content/docs/guide/configuration.ja.md @@ -420,6 +420,6 @@ llms.txt ファイルはコンテンツ構造から自動生成され、AI ツ title: "設定" params: images: - - "/img/config-image.jpg" + - "img/config-image.jpg" audio: "config-talk.mp3" ``` diff --git a/docs/content/docs/guide/configuration.md b/docs/content/docs/guide/configuration.md index 776fdc1..8d843ec 100644 --- a/docs/content/docs/guide/configuration.md +++ b/docs/content/docs/guide/configuration.md @@ -520,7 +520,7 @@ Other Open Graph properties can have only one value. title: "My Page" params: images: - - "/images/image01.jpg" + - "images/image01.jpg" audio: "podcast02.mp3" videos: - "video01.mp4" @@ -533,7 +533,7 @@ Page content. ```yaml {filename="hugo.yaml"} params: images: - - "/images/image01.jpg" + - "images/image01.jpg" audio: "podcast02.mp3" videos: - "video01.mp4" diff --git a/docs/content/docs/guide/configuration.zh-cn.md b/docs/content/docs/guide/configuration.zh-cn.md index 3efdd26..d901f04 100644 --- a/docs/content/docs/guide/configuration.zh-cn.md +++ b/docs/content/docs/guide/configuration.zh-cn.md @@ -420,6 +420,6 @@ llms.txt 文件根据内容结构自动生成,使 AI 工具和语言模型更 title: "配置" params: images: - - "/img/config-image.jpg" + - "img/config-image.jpg" audio: "config-talk.mp3" ``` diff --git a/layouts/_partials/opengraph.html b/layouts/_partials/opengraph.html index 140f248..91b9d3f 100644 --- a/layouts/_partials/opengraph.html +++ b/layouts/_partials/opengraph.html @@ -28,12 +28,20 @@ {{- else }} - + {{- $image := . -}} + {{- if hasPrefix $image "/" -}} + {{- $image = relURL (strings.TrimPrefix "/" $image) -}} + {{- end -}} + {{- end }} {{- end }} {{- else -}} {{- with $.Site.Params.images }} - + {{- $image := index . 0 -}} + {{- if hasPrefix $image "/" -}} + {{- $image = relURL (strings.TrimPrefix "/" $image) -}} + {{- end -}} + {{- end }} {{- end -}}