fix(og-image): handle leading slashes in image paths for subpath deployments (#901)
* fix(og-image): handle leading slashes in image paths for subpath deployments Fix Open Graph image paths not working correctly when deploying to subpaths (e.g., https://example.com/docs/). The issue occurred when image paths with leading slashes were specified in configuration, causing the subpath to be ignored. The fix follows the established pattern used throughout the theme by stripping leading slashes before applying relURL, ensuring paths respect the baseURL subpath configuration. - Update opengraph.html to process image paths consistently - Update configuration examples to remove leading slashes - Add investigation document explaining the issue and fix * chore: remove issue summary
This commit is contained in:
@@ -420,6 +420,6 @@ llms.txt ファイルはコンテンツ構造から自動生成され、AI ツ
|
||||
title: "設定"
|
||||
params:
|
||||
images:
|
||||
- "/img/config-image.jpg"
|
||||
- "img/config-image.jpg"
|
||||
audio: "config-talk.mp3"
|
||||
```
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -420,6 +420,6 @@ llms.txt 文件根据内容结构自动生成,使 AI 工具和语言模型更
|
||||
title: "配置"
|
||||
params:
|
||||
images:
|
||||
- "/img/config-image.jpg"
|
||||
- "img/config-image.jpg"
|
||||
audio: "config-talk.mp3"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user