Ajoute les articles relatifs et harmonise la page 404
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
{{- $page := .Page -}}
|
||||
{{- $coverPath := .Params.cover -}}
|
||||
{{- $isInterestingLink := strings.HasPrefix .RelPermalink "/interets/liens-interessants/" -}}
|
||||
{{- $page := . -}}
|
||||
{{- $title := .Title -}}
|
||||
{{- $showMeta := true -}}
|
||||
{{- if reflect.IsMap . -}}
|
||||
{{- with index . "Page" -}}
|
||||
{{- $page = . -}}
|
||||
{{- end -}}
|
||||
{{- with index . "Title" -}}
|
||||
{{- $title = . -}}
|
||||
{{- end -}}
|
||||
{{- if isset . "ShowMeta" -}}
|
||||
{{- $showMeta = index . "ShowMeta" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $coverPath := $page.Params.cover -}}
|
||||
{{- $isInterestingLink := strings.HasPrefix $page.RelPermalink "/interets/liens-interessants/" -}}
|
||||
{{- $showCover := and $coverPath (not $isInterestingLink) -}}
|
||||
{{- $linksParam := .Params.links -}}
|
||||
{{- $linksParam := $page.Params.links -}}
|
||||
{{- $links := slice -}}
|
||||
{{- if $linksParam -}}
|
||||
{{- $type := printf "%T" $linksParam -}}
|
||||
@@ -105,17 +119,17 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $coverImageTitle := default .Title (index $coverData "title") -}}
|
||||
{{- $coverImageTitle := default $title (index $coverData "title") -}}
|
||||
{{- $coverTitle := index $coverData "title" -}}
|
||||
{{- $coverDescription := index $coverData "description" -}}
|
||||
{{- $coverAttribution := index $coverData "attribution" -}}
|
||||
{{- $coverPrompt := index $coverData "prompt" -}}
|
||||
{{- $weather := .Params.weather -}}
|
||||
{{- $weather := $page.Params.weather -}}
|
||||
{{- $weatherIcon := "" -}}
|
||||
{{- $weatherLabel := "Météo" -}}
|
||||
{{- $weatherTitle := "" -}}
|
||||
{{- if and $weather (gt (len $weather) 0) -}}
|
||||
{{- $hour := (time .Date).Hour -}}
|
||||
{{- $hour := (time $page.Date).Hour -}}
|
||||
{{- $isNight := false -}}
|
||||
{{- if or (lt $hour 6) (ge $hour 18) -}}
|
||||
{{- $isNight = true -}}
|
||||
@@ -169,15 +183,15 @@
|
||||
{{- end -}}
|
||||
{{- $hasCoverImage := and $showCover $coverImage -}}
|
||||
{{- $hasCoverMeta := or $coverTitle $coverDescription $coverAttribution $coverPrompt -}}
|
||||
{{- $showReadingTime := ge .ReadingTime 5 -}}
|
||||
{{- $showReadingTime := ge $page.ReadingTime 5 -}}
|
||||
{{- $hasPublication := or $showReadingTime $hasWeatherIcon -}}
|
||||
{{- with .Date -}}
|
||||
{{- with $page.Date -}}
|
||||
{{- $hasPublication = true -}}
|
||||
{{- end -}}
|
||||
{{- $breadcrumbsMarkup := partial "breadcrumbs.html" . -}}
|
||||
{{- $breadcrumbsMarkup := partial "breadcrumbs.html" $page -}}
|
||||
{{- $hasBreadcrumbs := ne (strings.TrimSpace $breadcrumbsMarkup) "" -}}
|
||||
{{- $pageLinksMarkup := partial "page-links.html" (dict
|
||||
"Page" .
|
||||
"Page" $page
|
||||
"LinkClass" "ui-button"
|
||||
"Links" $remainingLinks
|
||||
) -}}
|
||||
@@ -185,11 +199,11 @@
|
||||
{{- $hasOriginCallout := and $isInterestingLink (ne $originURL "") -}}
|
||||
{{- $hasMetaMain := or $hasBreadcrumbs $hasPublication $hasPageLinks $hasOriginCallout -}}
|
||||
{{- $showCoverMeta := and (not $isInterestingLink) $coverPath $hasCoverMeta -}}
|
||||
{{- $hasMetaBlock := or $hasCoverImage $hasMetaMain $showCoverMeta -}}
|
||||
{{- $hasMetaBlock := and $showMeta (or $hasCoverImage $hasMetaMain $showCoverMeta) -}}
|
||||
|
||||
<header class="article-header{{ if $isInterestingLink }} article-header--interesting-link{{ end }}">
|
||||
{{ partialCached "header-brand.html" .Site .Site.Title (.Site.Params.logo | default "logo-large.png") }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ partialCached "header-brand.html" $page.Site $page.Site.Title ($page.Site.Params.logo | default "logo-large.png") }}
|
||||
<h1>{{ $title }}</h1>
|
||||
|
||||
{{- if $hasMetaBlock -}}
|
||||
<section class="article-meta-block{{ if not $hasCoverImage }} article-meta-block--without-cover{{ end }}">
|
||||
@@ -209,7 +223,7 @@
|
||||
|
||||
{{- if $hasPublication -}}
|
||||
<p class="article-publication">
|
||||
{{ with .Date }}
|
||||
{{ with $page.Date }}
|
||||
{{- $timePart := . | time.Format "15:04:05" -}}
|
||||
<time datetime="{{ . }}">
|
||||
{{- if eq $timePart "00:00:00" -}}
|
||||
@@ -228,7 +242,7 @@
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{- if $showReadingTime -}}
|
||||
<span>{{ .ReadingTime }} min de lecture</span>
|
||||
<span>{{ $page.ReadingTime }} min de lecture</span>
|
||||
{{- end -}}
|
||||
</p>
|
||||
{{- end -}}
|
||||
@@ -244,7 +258,7 @@
|
||||
"Title" "Lire la page d'origine"
|
||||
"Text" $originLinkText
|
||||
"Class" "ui-button article-origin-link-button-link"
|
||||
"Page" .
|
||||
"Page" $page
|
||||
) -}}
|
||||
</p>
|
||||
</section>
|
||||
@@ -266,7 +280,7 @@
|
||||
{{- end -}}
|
||||
{{- with $coverAttribution -}}
|
||||
{{- $attribution := partial "media/parse-attribution.html" . -}}
|
||||
<p class="cover-attribution"><strong>Attribution:</strong> <span>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $ "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
|
||||
<p class="cover-attribution"><strong>Attribution:</strong> <span>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $page "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
|
||||
{{- end -}}
|
||||
{{- with $coverPrompt -}}
|
||||
<details>
|
||||
|
||||
Reference in New Issue
Block a user