fix: update permalink handling in subpath setting
This commit is contained in:
@ -1,87 +1,87 @@
|
||||
<!-- The Side Bar -->
|
||||
<aside aria-label="Sidebar" id="sidebar" class="d-flex flex-column align-items-end">
|
||||
<header class="profile-wrapper">
|
||||
<a href="{{ .Site.Home.RelPermalink }}" id="avatar" class="rounded-circle">
|
||||
{{- if .Site.Params.avatar -}}
|
||||
{{- $avatar := resources.Get .Site.Params.avatar -}}
|
||||
{{- if $avatar -}}
|
||||
<img src="{{ $avatar.RelPermalink }}" width="112" height="112" alt="avatar" onerror="this.style.display='none'">
|
||||
{{- else -}}
|
||||
<img src="{{ .Site.Params.avatar | absURL }}" width="112" height="112" alt="avatar" onerror="this.style.display='none'">
|
||||
{{- end -}}
|
||||
<header class="profile-wrapper">
|
||||
<a href="{{ .Site.Home.RelPermalink }}" id="avatar" class="rounded-circle">
|
||||
{{- if .Site.Params.avatar -}}
|
||||
{{- $avatar := resources.Get .Site.Params.avatar -}}
|
||||
{{- if $avatar -}}
|
||||
<img src="{{ $avatar.RelPermalink }}" width="112" height="112" alt="avatar" onerror="this.style.display='none'">
|
||||
{{- else -}}
|
||||
<img src="{{ .Site.Params.avatar | absURL }}" width="112" height="112" alt="avatar" onerror="this.style.display='none'">
|
||||
{{- end -}}
|
||||
</a>
|
||||
|
||||
<a class="site-title d-block" href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a>
|
||||
{{ if .Site.Params.tagline }}
|
||||
<p class="site-subtitle fst-italic mb-0">{{ .Site.Params.tagline }}</p>
|
||||
{{ end }}
|
||||
</header>
|
||||
<!-- .profile-wrapper -->
|
||||
{{- end -}}
|
||||
</a>
|
||||
|
||||
<nav class="flex-column flex-grow-1 w-100 ps-0">
|
||||
<ul class="nav">
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ $active := false }}
|
||||
{{ if eq (.URL | relLangURL) $.RelPermalink }}
|
||||
{{ $active = true }}
|
||||
{{ end }}
|
||||
<li class="nav-item{{ if $active }} active{{ end }}">
|
||||
<a href="{{ .URL | relLangURL }}" class="nav-link">
|
||||
<i class="fa-fw fas {{ .Pre }}"></i>
|
||||
<span>{{ .Name | upper }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- .nav-item -->
|
||||
<a class="site-title d-block" href="{{ .Site.Home.RelPermalink }}">{{ .Site.Title }}</a>
|
||||
{{ if .Site.Params.tagline }}
|
||||
<p class="site-subtitle fst-italic mb-0">{{ .Site.Params.tagline }}</p>
|
||||
{{ end }}
|
||||
</header>
|
||||
<!-- .profile-wrapper -->
|
||||
|
||||
<nav class="flex-column flex-grow-1 w-100 ps-0">
|
||||
<ul class="nav">
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ $active := false }}
|
||||
{{ if eq (.URL) $.RelPermalink }}
|
||||
{{ $active = true }}
|
||||
{{ end }}
|
||||
<li class="nav-item mt-4">
|
||||
<a class="nav-link no-hover">
|
||||
<i class="fa-fw fas fa-language"></i>
|
||||
{{ partial "language-selector.html" . }}
|
||||
<li class="nav-item{{ if $active }} active{{ end }}">
|
||||
<a href="{{ .URL }}" class="nav-link">
|
||||
<i class="fa-fw fas {{ .Pre }}"></i>
|
||||
<span>{{ .Name | upper }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- .nav-item -->
|
||||
{{ end }}
|
||||
<li class="nav-item mt-4">
|
||||
<a class="nav-link no-hover">
|
||||
<i class="fa-fw fas fa-language"></i>
|
||||
{{ partial "language-selector.html" . }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-bottom d-flex flex-wrap align-items-center w-100">
|
||||
{{ if not .Site.Params.themeMode }}
|
||||
<button type="button" class="btn btn-link nav-link" aria-label="Switch Mode" id="mode-toggle">
|
||||
<i class="fas fa-adjust"></i>
|
||||
</button>
|
||||
|
||||
{{ if .Site.Params.social.links }}
|
||||
<span class="icon-border"></span>
|
||||
{{ end }}
|
||||
<div class="sidebar-bottom d-flex flex-wrap align-items-center w-100">
|
||||
{{ if not .Site.Params.themeMode }}
|
||||
<button type="button" class="btn btn-link nav-link" aria-label="Switch Mode" id="mode-toggle">
|
||||
<i class="fas fa-adjust"></i>
|
||||
</button>
|
||||
|
||||
{{ if .Site.Params.social.links }}
|
||||
<span class="icon-border"></span>
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.social.links }}
|
||||
{{ $url := "" }}
|
||||
{{ $rel := "" }}
|
||||
|
||||
{{ if eq .type "github" }}
|
||||
{{ $url = printf "https://github.com/%s" .id }}
|
||||
{{ else if eq .type "twitter" }}
|
||||
{{ $url = printf "https://twitter.com/%s" .id }}
|
||||
{{ else if eq .type "email" }}
|
||||
{{ $url = printf "mailto:%s" .id }}
|
||||
{{ else if eq .type "rss" }}
|
||||
{{ $url = "index.xml" | relLangURL }}
|
||||
{{ else }}
|
||||
{{ $url = .url }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $url }}
|
||||
<a
|
||||
href="{{ $url }}"
|
||||
aria-label="{{ .type }}"
|
||||
{{ if not .noblank }}target="_blank" rel="noopener noreferrer"{{ end }}
|
||||
{{ if eq .type "mastodon" }}rel="me"{{ end }}
|
||||
>
|
||||
<i class="{{ .icon }}"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.social.links }}
|
||||
{{ $url := "" }}
|
||||
{{ $rel := "" }}
|
||||
|
||||
{{ if eq .type "github" }}
|
||||
{{ $url = printf "https://github.com/%s" .id }}
|
||||
{{ else if eq .type "twitter" }}
|
||||
{{ $url = printf "https://twitter.com/%s" .id }}
|
||||
{{ else if eq .type "email" }}
|
||||
{{ $url = printf "mailto:%s" .id }}
|
||||
{{ else if eq .type "rss" }}
|
||||
{{ $url = "index.xml" | absLangURL }}
|
||||
{{ else }}
|
||||
{{ $url = .url }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<!-- .sidebar-bottom -->
|
||||
</aside>
|
||||
<!-- #sidebar -->
|
||||
|
||||
{{ if $url }}
|
||||
<a
|
||||
href="{{ $url }}"
|
||||
aria-label="{{ .type }}"
|
||||
{{ if not .noblank }}target="_blank" rel="noopener noreferrer"{{ end }}
|
||||
{{ if eq .type "mastodon" }}rel="me"{{ end }}
|
||||
>
|
||||
<i class="{{ .icon }}"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<!-- .sidebar-bottom -->
|
||||
</aside>
|
||||
<!-- #sidebar -->
|
Reference in New Issue
Block a user