gitInfo: configuration of the git repository

- Enables to set the git repository URL and type in the site
  configuration.
- Updates the footer to use that information.
- Updates the contact partial to use the configuration information of a
  custom git website.

Co-Authored-by: iGor milhit <igor@milhit.ch>
dev
iGor milhit 2022-11-06 20:50:30 +01:00
parent 989343ea59
commit 1aaa6b02b5
Signed by: igor
GPG Key ID: 692D97C3D0228A99
3 changed files with 20 additions and 8 deletions

View File

@ -1,3 +1,6 @@
[lastCommit]
other = "Dernier commit modifiant cette page"
[post-infos] [post-infos]
other = "Informations sur le billet" other = "Informations sur le billet"
@ -7,6 +10,5 @@ other = "Permalien"
[contactsPriv] [contactsPriv]
other = "Contacts personnels" other = "Contacts personnels"
[contactsPro] [contactsPro]
other = "Contacts professionnels" other = "Contacts professionnels"

View File

@ -1,7 +1,8 @@
{{ $currentPage := . -}}
{{ $siteSources := .Site.Params.siteSources }}
<footer class="main-footer no-print"> <footer class="main-footer no-print">
<nav role="navigation" aria-label="Secondary"> <nav role="navigation" aria-label="Secondary">
<ul> <ul>
{{ $currentPage := . -}}
{{ range sort .Site.Menus.footer -}} {{ range sort .Site.Menus.footer -}}
<li class="nav-item"> <li class="nav-item">
<a class="nav-item-link{{if or ($currentPage.IsMenuCurrent "footer" .) ($currentPage.HasMenuCurrent "footer" .) }} active{{end}}" <a class="nav-item-link{{if or ($currentPage.IsMenuCurrent "footer" .) ($currentPage.HasMenuCurrent "footer" .) }} active{{end}}"
@ -13,8 +14,14 @@
{{ $git := . }} {{ $git := . }}
<li> <li>
<code> <code>
<a href="https://framagit.org/iGormilhit/igor.milhit/-/commit/{{- $git.Hash -}}" <a href="
title="Dernier commit modifiant cette page"> {{- if eq $siteSources.type "gitlab" -}}
{{ $siteSources.url }}/-/
{{- else -}}
{{ $siteSources.url }}/
{{- end -}}
commit/{{- $git.Hash -}}"
title="{{ i18n "lastCommit" }}">
{{ $git.AbbreviatedHash }} {{ $git.AbbreviatedHash }}
</a> </a>
</code> </code>

View File

@ -1,16 +1,20 @@
<h2 id="online">Online</h2> <h2 id="online">Online</h2>
<dl class="home-lists"> <dl class="home-lists">
{{ with .Site.Params.online.git }}
<dt>Git</dt>
<dd><a href="{{ . }}" rel="me">{{ . }}</a></dd>
{{ end }}
{{ with .Site.Params.online.github }} {{ with .Site.Params.online.github }}
<dt>GitHub</dt> <dt>GitHub</dt>
<dd><a href="https://github.com/{{ . }}">{{ . }}</a></dd> <dd><a href="https://github.com/{{ . }}" rel="me">{{ . }}</a></dd>
{{ end }} {{ end }}
{{ with .Site.Params.online.framagit }} {{ with .Site.Params.online.framagit }}
<dt>Framagit</dt> <dt>Framagit</dt>
<dd><a href="https://framagit.org/{{ . }}">{{ . }}</a></dd> <dd><a href="https://framagit.org/{{ . }}" rel="me">{{ . }}</a></dd>
{{ end }} {{ end }}
{{ with .Site.Params.online.mastodon }} {{ with .Site.Params.online.mastodon }}
<dt>mastodon</dt> <dt>mastodon</dt>
<dd><a href="{{ . }}">{{ . }}</a></dd> <dd><a href="{{ . }}" rel="me">{{ . }}</a></dd>
{{ end }} {{ end }}
{{ with .Site.Params.online.twitter }} {{ with .Site.Params.online.twitter }}
<dt>Twitter</dt> <dt>Twitter</dt>
@ -32,5 +36,4 @@
<dt>Discogs</dt> <dt>Discogs</dt>
<dd><a href="https://www.discogs.com/user/{{ . }}">{{ . }}</a></dd> <dd><a href="https://www.discogs.com/user/{{ . }}">{{ . }}</a></dd>
{{ end }} {{ end }}
</dl> </dl>