Mise à jour du thème et améliorations de la mise en page
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Supprime les partiels surchargés (nav, SEO structuré) au profit du thème
amont, réécrit header.html sans Scratch pour la compatibilité Hugo moderne,
adapte footer et CSS au Bootstrap 5 (offset-*, list-inline-item, dropdown).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-06-23 14:42:14 +09:00
commit 3a1a890f67
8 changed files with 120 additions and 240 deletions

View file

@ -1,98 +1,42 @@
{{- $title := "" }}
{{- $subtitle := "" }}
{{- $bigimg := slice }}
{{- $headerImgStyle := "big" }}
{{- $thumbs := slice }}
{{- $contentColClass := cond .Params.fullWidth "col-12" "col-md-10 offset-md-1" }}
{{- $mainSections := default (slice "post" "posts") site.Params.mainSections }}
{{- $isMainContent := in $mainSections .Type }}
{{ if .IsHome }}
{{ if .Site.Params.homeTitle }}{{ $.Scratch.Set "title" .Site.Params.homeTitle }}{{ end }}
{{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }}
{{ if .Site.Params.bigimg }}{{ $.Scratch.Set "bigimg" .Site.Params.bigimg }}{{ end }}
{{ if .Site.Params.thumb }}{{ $.Scratch.Set "thumb" .Site.Params.thumb }}{{ end }}
{{- $title = .Site.Params.homeTitle | default .Site.Title }}
{{- $subtitle = .Site.Params.subtitle }}
{{- $bigimg = .Site.Params.bigimg }}
{{- $headerImgStyle = .Site.Params.headerImgStyle | default "big" }}
{{- $thumbs = .Site.Params.thumb }}
{{ else }}
{{ $.Scratch.Set "title" .Title }}
{{ if .Params.subtitle }}{{ $.Scratch.Set "subtitle" .Params.subtitle }}{{ end }}
{{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }}
{{- $title = .Title }}
{{- $subtitle = .Params.subtitle }}
{{- $bigimg = .Params.bigimg }}
{{- $headerImgStyle = .Params.headerImgStyle | default "big" }}
{{ end }}
{{ $bigimg := $.Scratch.Get "bigimg" }}
{{ $title := $.Scratch.Get "title" }}
{{ $subtitle := $.Scratch.Get "subtitle" }}
{{ $thumbs := $.Scratch.Get "thumb" }}
{{ if or (or $bigimg $title) $thumbs }}
{{ if $bigimg }}
<div id="header-big-imgs" data-num-img={{len $bigimg}}
{{range $i, $img := $bigimg}}
{{ if (fileExists $img.src)}}
data-img-src-{{add $i 1}}="{{$img.src | absURL }}"
{{else}}
data-img-src-{{add $i 1}}="{{$img.src}}"
{{end}}
data-img-src-{{add $i 1}}="{{ strings.TrimPrefix "/" $img.src | relURL }}"
{{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}
{{ if $img.position}}data-img-position-{{add $i 1}}="{{$img.position}}"{{end}}
{{end}}></div>
{{ end }}
<header class="header-section {{ if $bigimg }}has-img{{ end }}">
{{ if $bigimg }}
<div class="intro-header big-img">
{{ $subtitle := $.Scratch.Get "subtitle" }}
<div class="container">
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1">
<div class="{{ .Type }}-heading">
<h1>{{ with $.Scratch.Get "title" }}{{.}}{{ else }}<br/>{{ end }}</h1>
{{ if $subtitle }}
{{ if eq .Type "page" }}
<hr class="small">
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
{{ else }}
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
{{ end }}
{{ end }}
{{ if eq .Type "post" }}
{{ partial "post_meta.html" . }}
{{ end }}
</div>
</div>
</div>
</div>
<span class="img-desc" style="display: inline;"></span>
</div>
{{end}}
{{ if $title }}
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1">
<div class="{{ .Type }}-heading">
{{ if eq .Type "list" }}
<h1>{{ if .Data.Singular }}#{{ end }}{{ .Title }}</h1>
{{ else }}
<h1>{{ with $title }}{{.}}{{ else }}<br/>{{ end }}</h1>
{{ end }}
{{ if ne .Type "post" }}
<hr class="small">
{{ end }}
{{ if $subtitle }}
{{ if eq .Type "page" }}
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
{{ else }}
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
{{ end }}
{{ end }}
{{ if eq .Type "post" }}
{{ partial "post_meta.html" . }}
{{ end }}
</div>
</div>
</div>
</div>
</div>
{{ else }}
<div class="intro-header no-img"></div>
{{end}}
{{ if $thumbs }}
<div class="container">
<div class="container" style="margin-top: 160px;">
<div class="thumbApps">
{{range $i, $thumb := $thumbs}}
<a href="{{ $thumb.link | absURL }}" target="_blank">
<div class="thumbApp" style="background-image:url('{{ $thumb.src | absURL }}')">
{{ if $thumb.desc }}<p><span>{{ $thumb.desc }}</span></p>{{end}}
{{range $thumbs}}
<a href="{{ .link | absURL }}" target="_blank">
<div class="thumbApp" style="background-image:url('{{ .src | absURL }}')">
{{ if .desc }}<p><span>{{ .desc }}</span></p>{{end}}
</div>
</a>
{{ end }}
@ -100,6 +44,57 @@
<hr class="small">
</div>
{{ end }}
{{ if $bigimg }}
{{- $firstimg := index $bigimg 0 }}
<div class="intro-header big-img{{ if eq $headerImgStyle "narrow" }} narrow-img{{ end }}" style="background-image: url('{{ strings.TrimPrefix "/" $firstimg.src | relURL }}');">
<div class="container">
<div class="row">
<div class="{{$contentColClass}}">
<div class="{{ .Type }}-heading">
<h1>{{ with $title }}{{.}}{{ else }}<br/>{{ end }}</h1>
{{ if not $isMainContent }}
<hr class="small">
{{ end }}
{{ partial "header-subtitle.html" (dict "Context" . "Subtitle" $subtitle) }}
{{ if $isMainContent }}
{{ partial "post_meta.html" . }}
{{ end }}
</div>
</div>
</div>
</div>
<span class="img-desc" style="display: {{ cond (isset $firstimg "desc") "inline" "none"}};">{{$firstimg.desc}}</span>
</div>
{{end}}
{{ if and $title (not $thumbs) }}
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="{{$contentColClass}}">
<div class="{{ .Type }}-heading">
{{ if $bigimg }}
<span class="h1">{{ with $title }}{{.}}{{ else }}<br/>{{ end }}</span>
{{ else }}
{{ if eq .Type "list" }}
<h1>{{ if .Data.Singular }}#{{ end }}{{ .Title }}</h1>
{{ else }}
<h1>{{ with $title }}{{.}}{{ else }}<br/>{{ end }}</h1>
{{ end }}
{{ end }}
{{ if not $isMainContent }}
<hr class="small">
{{ end }}
{{ partial "header-subtitle.html" (dict "Context" . "Subtitle" $subtitle) }}
{{ if $isMainContent }}
{{ partial "post_meta.html" . }}
{{ end }}
</div>
</div>
</div>
</div>
</div>
{{ end }}
{{ partial "header_custom.html" . }}
</header>
{{ else }}
<div class="intro-header"></div>