Merge pull request #174 from nunocoracao/173-author-links-are-broken

fixed broken author links
This commit is contained in:
Nuno Coração 2022-10-29 19:11:52 +01:00 committed by GitHub
commit aa57505c94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -3,7 +3,7 @@
# https://nunocoracao.github.io/blowfish/docs/getting-started/
theme = "blowfish"
baseURL = "https://nunocoracao.github.io/blowfish/"
baseURL = "https://nunocoracao.github.io/blowfish"
defaultContentLanguage = "en"
enableRobotsTXT = true

View file

@ -31,7 +31,7 @@
<div class="min-w-0 min-h-0 max-w-prose">
{{ partial "series.html" . }}
{{ .Content | emojify }}
</br></br></br>
</br></br>
{{ partial "series-closed.html" . }}
</div>
<script>
@ -168,6 +168,11 @@
{{ $authorsData := .Site.Data.authors }}
{{ $taxonomies := .Site.Taxonomies.authors }}
{{ $baseURL := .Site.BaseURL }}
{{ if not (strings.HasSuffix $baseURL "/") }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
{{ end }}
{{ range $author := .Page.Params.authors }}
{{ $authorData := index $authorsData $author }}
{{- if $authorData -}}
@ -175,7 +180,7 @@
{{ $taxonomyLink := 0 }}
{{ range $taxonomyname, $taxonomy := $taxonomies }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author) "" }}
{{ $taxonomyLink = delimit (slice $baseURL "/authors/" $author) "" }}
{{ end }}
{{ end }}