mirror of
https://github.com/tiennm99/iammiti99.git
synced 2026-10-11 03:13:37 +00:00
Hugo's relURL/absURL on a leading-slash path treats it as root-absolute and skips the baseURL subpath. Strip the prefix first so user-supplied paths like '/images/avatar.svg' resolve correctly under https://*.github.io/<repo>/.
30 lines
755 B
HTML
30 lines
755 B
HTML
{{- $name := site.Params.name | default site.Title -}}
|
|
{{- $tagline := site.Params.tagline -}}
|
|
{{- $bio := site.Params.bio -}}
|
|
{{- $avatar := site.Params.avatar -}}
|
|
{{- $links := site.Params.links -}}
|
|
|
|
<article class="bio">
|
|
{{- if $avatar }}
|
|
<img class="bio__avatar" src="{{ $avatar | strings.TrimPrefix "/" | relURL }}" alt="{{ $name }}" loading="eager" />
|
|
{{- end }}
|
|
|
|
<h1 class="bio__name">{{ $name }}</h1>
|
|
|
|
{{- with $tagline }}
|
|
<p class="bio__tagline">{{ . }}</p>
|
|
{{- end }}
|
|
|
|
{{- with $bio }}
|
|
<p class="bio__text">{{ . | markdownify }}</p>
|
|
{{- end }}
|
|
|
|
{{- if $links }}
|
|
<nav class="bio__links" aria-label="Links">
|
|
{{- range $links }}
|
|
{{- partial "link-button.html" . -}}
|
|
{{- end }}
|
|
</nav>
|
|
{{- end }}
|
|
</article>
|