mirror of https://github.com/onweru/compose.git

Guillaume
15.12.2023 1faabb60a1f9967f9f09d43ea6c2c6d5fb745bff
Add dynamic localization to author URL in footer

Say the author URL is `about/legal`, then `absLangURL` makes sure
1. it will go to the right page of the current language
2. it will not be a relative link (which breaks when in other sections)

External URL (starting with `http(s)://` will still work.
1 files modified
2 ■■■ changed files
layouts/partials/footer.html 2 ●●● patch | view | raw | blame | history
layouts/partials/footer.html
@@ -2,7 +2,7 @@
<footer class="pt-2 pb-2">
  <div class="wrap">
    {{- $author := site.Params.author }}
    <p>&copy; <span class="year">{{ now.Year }}</span>{{ with $author }} <a href ="{{ .url }}" target="_blank" rel="noopener">{{ .name }}</a>{{ end }}</p>
    <p>&copy; <span class="year">{{ now.Year }}</span>{{ with $author }} <a href ="{{ absLangURL .url }}" target="_blank" rel="noopener">{{ .name }}</a>{{ end }}</p>
    <a href="#pagetop" id="toTop" title={{ T "to_top" }}></a>
  </div>
</footer>