Skip to content

Commit

Permalink
WIP: Tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
carrete committed Jan 5, 2025
1 parent 2bce4a3 commit e679cc5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
{{ block "main" . }}{{ end }}
</main>
<footer>
{{ $customFooter := (printf "partials/custom_footer.%s.html" .Site.LanguageCode) }}
{{ if templates.Exists $customFooter }}
{{ partial $customFooter . }}
{{ end }}
{{ partial "footer.html" . }}
</footer>

Expand Down
2 changes: 0 additions & 2 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ <h3>Filtering for "{{ .Title }}"</h3>
{{ range .Paginator.Pages }}
<li>
<span>
<i>
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
</time>
</i>
</span>
{{ if .Params.link }}
<a href="{{ .Params.link }}" target="_blank">{{ .Title }} ↪</a>
Expand Down
3 changes: 1 addition & 2 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{{ if not .Site.Params.hideMadeWithLine }}
<span>
{{ if .Site.Copyright }}|{{ end }}
Made with
<a href="https://github.com/maolonglong/hugo-simple/">Hugo ʕ•ᴥ•ʔ Simple</a>
{{ markdownify .Site.Params.madeWith }}
</span>
{{ end }}
20 changes: 19 additions & 1 deletion layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
>
{{ end }}
{{ if not .Site.Params.hideRSSLink }}
<a href="{{ relURL "index.xml" }}">
<a href="{{ relURL (printf "%s/index.xml" .Page.Lang) }}">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 448 512">
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
Expand All @@ -17,3 +17,21 @@
RSS
</a>
{{ end }}

<!-- Convert this page's translations into a dict -->
{{ $translations := dict }}
{{ range .Translations }}
{{ $translations = merge $translations (dict .Language.Lang .) }}
{{ end }}

<!-- Create a link to every translation -->
{{ range where .Site.Languages "Lang" "!=" .Page.Lang }}
{{ with (index $translations .Lang) }}
<a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a>
{{ else }}
<!-- The complicated setup was necessary to make a grayed out link -->
{{ if not .Params.hideUntranslated }}
<a class="disabled" role="link" aria-disabled="true">{{ .LanguageName }}</a>
{{ end }}
{{ end }}
{{ end }}

0 comments on commit e679cc5

Please sign in to comment.