fix(layouts): use absURL for asset paths so subpath deploys work

relURL leaves leading-slash paths untouched, breaking sites served
from a subpath like https://*.github.io/bonsai/. absURL prepends the
full baseURL (including subpath) and works in both root and subpath
deployments. Affects: avatar img, favicon link, css link, theme-toggle
script.
This commit is contained in:
tiennm99 committed 2026-05-01 16:39:26 +07:00
1 parent da8da904c7
commit bed9259188
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@
<article class="bio">
{{- if $avatar }}
<img class="bio__avatar" src="{{ $avatar | relURL }}" alt="{{ $name }}" loading="eager" />
<img class="bio__avatar" src="{{ $avatar | absURL }}" alt="{{ $name }}" loading="eager" />
{{- end }}
<h1 class="bio__name">{{ $name }}</h1>
+3 -3
View File
@@ -20,8 +20,8 @@
{{- end }}
<meta name="twitter:card" content="summary" />
<link rel="icon" href="{{ site.Params.favicon | default `/favicon.ico` }}" />
<link rel="stylesheet" href="{{ `css/bonsai.css` | relURL }}" />
<link rel="icon" href="{{ (site.Params.favicon | default `/favicon.ico`) | absURL }}" />
<link rel="stylesheet" href="{{ `css/bonsai.css` | absURL }}" />
{{- if site.Params.themeToggle }}
<script defer src="{{ `js/theme-toggle.js` | relURL }}"></script>
<script defer src="{{ `js/theme-toggle.js` | absURL }}"></script>
{{- end }}