1

Ajout d'un bloc d'historique de modifications

This commit is contained in:
2026-04-05 00:37:25 +02:00
parent adcb370623
commit e3ba6446b4
6 changed files with 145 additions and 1 deletions

View File

@@ -7,6 +7,10 @@ main:
title: "Comment me contacter ?"
pageRef: /contact/
parent: Accueil
- name: Forge logicielle
title: "Mes dépôts git"
pageRef: https://git.dern.ovh
parent: Accueil
- name: Flux RSS
title: Restez au courant de mes publications grâce à mon flux RSS
pageRef: /index.xml

View File

@@ -4,6 +4,7 @@ favicon: /favicon.png
logo: logo-large.png
description: "Richard Dern et ses opinions impopulaires"
themeColor: "#060c14"
repositoryURL: https://git.dern.ovh/blog/2025
search:
action: /recherche/
param: q

View File

@@ -24,6 +24,9 @@
<meta name="description" content="{{ . }}">
{{- end }}
<meta name="theme-color" content="{{ $page.Site.Params.themeColor | default "#060c14" }}">
{{- with $page.Site.Params.repositoryURL }}
<meta name="repository" content="{{ . }}">
{{- end }}
<meta name="robots" content="{{ $robots }}">
<link rel="canonical" href="{{ $page.Permalink }}">
<meta property="og:locale" content="{{ $locale }}">

View File

@@ -618,6 +618,11 @@ main > article > section.article-asides > section.article-taxonomies {
background: linear-gradient(180deg, rgba(93, 134, 173, 0.18) 0%, rgba(17, 27, 42, 0.56) 100%);
}
main > article > section.article-asides > section.article-change-history {
border-top-color: var(--color-section-divider-2);
background: linear-gradient(180deg, rgba(143, 106, 216, 0.2) 0%, rgba(17, 27, 42, 0.56) 100%);
}
main > article > section.article-asides > section.article-aside-block > h2 {
margin-top: 0;
margin-bottom: 0;
@@ -738,6 +743,93 @@ body > main.taxonomy-page > section > ul > li > sub {
color: var(--color-text-muted);
}
main > article > section.article-asides > section.article-change-history > ol {
--article-change-history-marker-size: 1rem;
--article-change-history-marker-offset: 0.25rem;
--article-change-history-marker-top: 0.25rem;
--article-change-history-marker-center: calc(
var(--article-change-history-marker-offset) + (var(--article-change-history-marker-size) / 2)
);
list-style: none;
margin-top: var(--space-3);
padding-left: 0;
}
main > article > section.article-asides > section.article-change-history > ol > li {
margin-top: 0;
position: relative;
padding-left: calc(var(--space-6) + 0.2rem);
}
main > article > section.article-asides > section.article-change-history > ol > li + li {
margin-top: var(--space-4);
}
main > article > section.article-asides > section.article-change-history > ol > li::before {
content: "";
position: absolute;
z-index: 1;
inset-block-start: var(--article-change-history-marker-top);
inset-inline-start: var(--article-change-history-marker-offset);
width: var(--article-change-history-marker-size);
height: var(--article-change-history-marker-size);
border: 2px solid #d3b9ff;
border-radius: 50%;
background: #121b2c;
box-shadow: 0 0 0 0.2rem rgba(143, 106, 216, 0.18);
}
main > article > section.article-asides > section.article-change-history > ol > li::after {
content: "";
position: absolute;
inset-block-start: calc(
var(--article-change-history-marker-top) + (var(--article-change-history-marker-size) / 2)
);
inset-inline-start: calc(
var(--article-change-history-marker-center) - (var(--border-width-regular) / 2)
);
z-index: 0;
width: var(--border-width-regular);
height: calc(100% + var(--space-4));
border-radius: 999px;
background: linear-gradient(180deg, rgba(211, 185, 255, 0.7) 0%, rgba(143, 106, 216, 0.36) 100%);
}
main > article > section.article-asides > section.article-change-history > ol > li:last-child::after {
content: none;
}
main > article > section.article-asides > section.article-change-history > ol > li > :is(a, div) {
display: flex;
flex-direction: column;
gap: 0.25rem;
position: relative;
z-index: 1;
color: inherit;
text-decoration: none;
}
main > article > section.article-asides > section.article-change-history > ol > li > :is(a, div) > span.article-change-history-subject {
font-family: var(--font-heading);
font-size: 1.08rem;
line-height: 1.2;
color: var(--color-heading);
}
main > article > section.article-asides > section.article-change-history > ol > li > a:is(:hover, :focus-visible) > span.article-change-history-subject {
color: #f3ddff;
text-decoration: underline;
}
main > article > section.article-asides > section.article-change-history > ol > li > :is(a, div) > time {
font-size: 0.86rem;
line-height: 1.4;
color: #d8c8f3;
letter-spacing: 0.05em;
text-transform: uppercase;
font-family: var(--font-heading);
}
main > article > section.article-books {
margin-block: var(--article-feature-block-margin);
border-top: var(--border-width-regular) solid var(--color-accent-3);

View File

@@ -1,8 +1,9 @@
{{- $commentsMarkup := strings.TrimSpace (partial "asides/comments.html" .) -}}
{{- $keywordsMarkup := strings.TrimSpace (partial "asides/keywords.html" .) -}}
{{- $changeHistoryMarkup := strings.TrimSpace (partial "article-change-history.html" .) -}}
{{- $furtherReadingMarkup := strings.TrimSpace (partial "article-further-reading.html" .) -}}
{{- $relatedMarkup := strings.TrimSpace (partial "article-related.html" .) -}}
{{- if or (ne $commentsMarkup "") (ne $keywordsMarkup "") (ne $furtherReadingMarkup "") (ne $relatedMarkup "") -}}
{{- if or (ne $commentsMarkup "") (ne $keywordsMarkup "") (ne $changeHistoryMarkup "") (ne $furtherReadingMarkup "") (ne $relatedMarkup "") -}}
<section class="article-asides">
{{- with $commentsMarkup -}}
{{- . | safeHTML -}}
@@ -16,5 +17,8 @@
{{- with $relatedMarkup -}}
{{- . | safeHTML -}}
{{- end -}}
{{- with $changeHistoryMarkup -}}
{{- . | safeHTML -}}
{{- end -}}
</section>
{{- end -}}

View File

@@ -0,0 +1,40 @@
{{- with .GitInfo -}}
{{- $history := slice . -}}
{{- range .Ancestors -}}
{{- $history = $history | append . -}}
{{- end -}}
{{- $repositoryURL := "" -}}
{{- $diffAnchor := "" -}}
{{- with $.Site.Params.repositoryURL -}}
{{- $repositoryURL = strings.TrimSuffix "/" (strings.TrimSpace .) -}}
{{- end -}}
{{- with $.File.Path -}}
{{- $diffAnchor = printf "#diff-%s" (sha1 (printf "content/%s" .)) -}}
{{- end -}}
{{- if gt (len $history) 0 -}}
<section class="article-aside-block article-change-history">
<h2>Historique des modifications</h2>
<ol>
{{- range $history -}}
{{- $commitURL := "" -}}
{{- if ne $repositoryURL "" -}}
{{- $commitURL = printf "%s/commit/%s%s" $repositoryURL .Hash $diffAnchor -}}
{{- end -}}
<li>
{{- if ne $commitURL "" -}}
<a href="{{ $commitURL }}" title="Consulter ce commit dans la forge" rel="noreferrer noopener">
<span class="article-change-history-subject">{{ .Subject }}</span>
<time datetime="{{ .CommitDate.Format "2006-01-02T15:04:05Z07:00" }}">{{ printf "%s à %s" (.CommitDate | time.Format "02/01/2006") (.CommitDate | time.Format "15:04") }}</time>
</a>
{{- else -}}
<div>
<span class="article-change-history-subject">{{ .Subject }}</span>
<time datetime="{{ .CommitDate.Format "2006-01-02T15:04:05Z07:00" }}">{{ printf "%s à %s" (.CommitDate | time.Format "02/01/2006") (.CommitDate | time.Format "15:04") }}</time>
</div>
{{- end -}}
</li>
{{- end -}}
</ol>
</section>
{{- end -}}
{{- end -}}