mirror of
https://github.com/tiennm99/bonsai.git
synced 2026-10-03 05:19:09 +00:00
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:
1 parent
da8da904c7
commit
bed9259188
2 files changed
+4
-4
No files matched your search
@@ -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>
|
||||
|
||||
@@ -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 }}
|
||||
Reference in new issue
Block a user