Compare commits
16 Commits
main
...
42be182916
| Author | SHA1 | Date | |
|---|---|---|---|
| 42be182916 | |||
| 20ff3b861b | |||
| 10be4bfa5d | |||
| d7064aacbb | |||
| 1a341d428e | |||
| c28e9ffeaa | |||
| b180242590 | |||
| 5b355aca6a | |||
| a849a21e59 | |||
| 267f580648 | |||
| 188e996581 | |||
| 6efbecc07a | |||
| 6745469841 | |||
| 208a873d80 | |||
| 5e00c0c7c4 | |||
| 7f614688d0 |
@@ -7,12 +7,6 @@ disableHugoGeneratorInject: true
|
|||||||
enableEmoji: true
|
enableEmoji: true
|
||||||
timeZone: Europe/Paris
|
timeZone: Europe/Paris
|
||||||
theme: ["2026"]
|
theme: ["2026"]
|
||||||
security:
|
|
||||||
funcs:
|
|
||||||
getenv:
|
|
||||||
- "^HUGO_"
|
|
||||||
- "^CI$"
|
|
||||||
- "^MEILI_SEARCH_API_KEY$"
|
|
||||||
params:
|
params:
|
||||||
lists:
|
lists:
|
||||||
layout: spotlight
|
layout: spotlight
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ favicon: /favicon.png
|
|||||||
# Pas de / pour les ressources qui seront transformées
|
# Pas de / pour les ressources qui seront transformées
|
||||||
# Et les placer dans /assets et non dans /static
|
# Et les placer dans /assets et non dans /static
|
||||||
logo: logo-large.png
|
logo: logo-large.png
|
||||||
description: "Richard Dern et ses opinions impopulaires"
|
description: "et ses opinions impopulaires"
|
||||||
themeColor: "#060c14"
|
|
||||||
search:
|
search:
|
||||||
action: /recherche/
|
action: /recherche/
|
||||||
param: q
|
param: q
|
||||||
meilisearch:
|
meilisearch:
|
||||||
endpoint: /api/search
|
endpoint: /api/search
|
||||||
indexUid: blog_posts
|
indexUid: blog_posts
|
||||||
|
apiKey: "cf49bcdb1b08e5c502c41956d38ce0be80d5e79e9f084e6f15f4485f87d63c30"
|
||||||
hitsPerPage: 20
|
hitsPerPage: 20
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
#title: ""
|
|
||||||
#attribution: ""
|
|
||||||
description: "L'alias `comportement_suspect` se remplit tout seul désormais."
|
|
||||||
#prompt: ""
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#title: ""
|
|
||||||
#attribution: ""
|
|
||||||
description: "Vue simplifiée de mon architecture réseau."
|
|
||||||
#prompt: ""
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#title: ""
|
|
||||||
attribution: "ChatGPT Auto"
|
|
||||||
description: "Collaboration entre Caddy et OPNsense pour filtrer les comportements suspects sur mon site."
|
|
||||||
prompt: "Dynamic digital illustration showing collaboration between a Caddy web server and an OPNsense firewall to block suspicious IP addresses while remaining bot-friendly. Split cyber-security themed scene: on the left a modern server rack with the Caddy logo and a glowing blue protective shield, friendly small robot bots representing legitimate crawlers; on the right an OPNsense firewall server emitting an orange security shield. In the center a digital warning panel reading ‘Access Denied – Suspicious IP’ with network traffic being filtered. Dark cyber-security environment with world map, network lines, glowing circuits, blue vs orange lighting contrast, cinematic lighting, high-detail, wide banner illustration suitable as a blog header."
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#title: ""
|
|
||||||
#attribution: ""
|
|
||||||
description: "Ce petit malotru vérifie si je fais tourner WordPress. Pour la dernière fois."
|
|
||||||
#prompt: ""
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
flowchart LR
|
|
||||||
internet[Internet]
|
|
||||||
freebox[Freebox<br/>mode bridge]
|
|
||||||
opnsense[Routeur<br/>OPNsense + Caddy]
|
|
||||||
|
|
||||||
internet --> freebox --> opnsense
|
|
||||||
|
|
||||||
subgraph lan[Réseau local]
|
|
||||||
direction TB
|
|
||||||
server[server-main<br/>NixOS + Caddy<br/>Héberge mon blog]
|
|
||||||
others[Autres machines physiques<br/>Autres services web]
|
|
||||||
end
|
|
||||||
|
|
||||||
opnsense -->|Reverse-proxy| server
|
|
||||||
opnsense -->|Reverse-proxy| others
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 90 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 371 KiB |
File diff suppressed because it is too large
Load Diff
@@ -1,18 +0,0 @@
|
|||||||
{{- $description := .Description | default "" -}}
|
|
||||||
{{- if not $description -}}
|
|
||||||
{{- $description = .Summary | plainify | htmlUnescape -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if not $description -}}
|
|
||||||
{{- $description = .Plain | htmlUnescape -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if not $description -}}
|
|
||||||
{{- $description = .Content | plainify | htmlUnescape -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if not $description -}}
|
|
||||||
{{- $description = site.Params.description | default "" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $description = $description | replaceRE "\\s+" " " | strings.TrimSpace -}}
|
|
||||||
{{- if gt (len $description) 180 -}}
|
|
||||||
{{- $description = truncate 180 $description -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- return $description -}}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
{{- $title := site.Title -}}
|
|
||||||
{{- if not .IsHome -}}
|
|
||||||
{{- $title = printf "%s | %s" .Title site.Title -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $socialTitle := site.Title -}}
|
|
||||||
{{- if not .IsHome -}}
|
|
||||||
{{- $socialTitle = .Title -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $description := partial "head/description.html" . -}}
|
|
||||||
{{- $socialImage := partial "head/social-image.html" . -}}
|
|
||||||
{{- $searchPath := site.Params.search.action | relURL -}}
|
|
||||||
{{- $isSearchPage := eq .RelPermalink $searchPath -}}
|
|
||||||
{{- $robots := "max-image-preview:large" -}}
|
|
||||||
{{- if $isSearchPage -}}
|
|
||||||
{{- $robots = "noindex, follow" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $ogType := "website" -}}
|
|
||||||
{{- if and .IsPage (not $isSearchPage) -}}
|
|
||||||
{{- $ogType = "article" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $localeCode := site.LanguageCode | default site.Language.LanguageCode | default "fr-FR" -}}
|
|
||||||
{{- $locale := replace $localeCode "-" "_" -}}
|
|
||||||
<title>{{ $title }}</title>
|
|
||||||
{{- with $description }}
|
|
||||||
<meta name="description" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
<meta name="theme-color" content="{{ site.Params.themeColor | default "#060c14" }}">
|
|
||||||
<meta name="robots" content="{{ $robots }}">
|
|
||||||
<link rel="canonical" href="{{ .Permalink }}">
|
|
||||||
<meta property="og:locale" content="{{ $locale }}">
|
|
||||||
<meta property="og:site_name" content="{{ site.Title }}">
|
|
||||||
<meta property="og:type" content="{{ $ogType }}">
|
|
||||||
<meta property="og:title" content="{{ $socialTitle }}">
|
|
||||||
<meta property="og:url" content="{{ .Permalink }}">
|
|
||||||
{{- with $description }}
|
|
||||||
<meta property="og:description" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- with $socialImage.url }}
|
|
||||||
<meta property="og:image" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- with $socialImage.width }}
|
|
||||||
<meta property="og:image:width" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- with $socialImage.height }}
|
|
||||||
<meta property="og:image:height" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- with $socialImage.alt }}
|
|
||||||
<meta property="og:image:alt" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
<meta name="twitter:card" content="summary">
|
|
||||||
<meta name="twitter:title" content="{{ $socialTitle }}">
|
|
||||||
{{- with $description }}
|
|
||||||
<meta name="twitter:description" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- with $socialImage.url }}
|
|
||||||
<meta name="twitter:image" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- with $socialImage.alt }}
|
|
||||||
<meta name="twitter:image:alt" content="{{ . }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq $ogType "article" -}}
|
|
||||||
{{- with .Date }}
|
|
||||||
<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Lastmod }}
|
|
||||||
<meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{{- $image := false -}}
|
|
||||||
{{- $isCoverImage := false -}}
|
|
||||||
{{- $alt := "" -}}
|
|
||||||
{{- with .Params.cover -}}
|
|
||||||
{{- $cover := $.Resources.GetMatch . -}}
|
|
||||||
{{- if and $cover (ne $cover.MediaType.SubType "svg") -}}
|
|
||||||
{{- $image = $cover -}}
|
|
||||||
{{- $isCoverImage = true -}}
|
|
||||||
{{- $coverName := path.Base . | replaceRE "\\.[^.]+$" "" -}}
|
|
||||||
{{- $coverDataFile := $.Resources.Get (printf "data/images/%s.yaml" $coverName) -}}
|
|
||||||
{{- if not $coverDataFile -}}
|
|
||||||
{{- $coverDataFile = $.Resources.Get (printf "data/%s.yaml" $coverName) -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $coverData := dict -}}
|
|
||||||
{{- if $coverDataFile -}}
|
|
||||||
{{- $coverData = $coverDataFile.Content | transform.Unmarshal -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $alt = index $coverData "description" | default "" -}}
|
|
||||||
{{- if not $alt -}}
|
|
||||||
{{- $alt = index $coverData "title" | default "" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if not $image -}}
|
|
||||||
{{- $logoPath := site.Params.logo | default "logo-large.png" -}}
|
|
||||||
{{- $logo := resources.GetMatch $logoPath -}}
|
|
||||||
{{- if and $logo (ne $logo.MediaType.SubType "svg") -}}
|
|
||||||
{{- $image = $logo -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if not $alt -}}
|
|
||||||
{{- if and $image $isCoverImage -}}
|
|
||||||
{{- if and .IsPage (not .IsHome) -}}
|
|
||||||
{{- $alt = printf "Image de partage pour %s" .Title -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $alt = printf "Logo du site %s" site.Title -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- else if $image -}}
|
|
||||||
{{- $alt = printf "Logo du site %s" site.Title -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $data := dict -}}
|
|
||||||
{{- if $image -}}
|
|
||||||
{{- $data = dict
|
|
||||||
"url" $image.Permalink
|
|
||||||
"alt" ($alt | strings.TrimSpace | truncate 420)
|
|
||||||
-}}
|
|
||||||
{{- with $image.Width -}}
|
|
||||||
{{- $data = merge $data (dict "width" .) -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- with $image.Height -}}
|
|
||||||
{{- $data = merge $data (dict "height" .) -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- return $data -}}
|
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{- $search := .Site.Params.search -}}
|
{{- $search := .Site.Params.search -}}
|
||||||
{{- $meili := $search.meilisearch -}}
|
{{- $meili := $search.meilisearch -}}
|
||||||
{{- $apiKey := getenv "MEILI_SEARCH_API_KEY" -}}
|
|
||||||
{{- if eq $apiKey "" -}}
|
|
||||||
{{- errorf "MEILI_SEARCH_API_KEY is required to render the search page" -}}
|
|
||||||
{{- end -}}
|
|
||||||
<header class="article-header">
|
<header class="article-header">
|
||||||
{{ partialCached "header-brand.html" .Site .Site.Title (.Site.Params.logo | default "logo-large.png") }}
|
{{ partialCached "header-brand.html" .Site .Site.Title (.Site.Params.logo | default "logo-large.png") }}
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
@@ -13,7 +9,7 @@
|
|||||||
class="search-page"
|
class="search-page"
|
||||||
data-search-endpoint="{{ $meili.endpoint }}"
|
data-search-endpoint="{{ $meili.endpoint }}"
|
||||||
data-search-index="{{ $meili.indexUid }}"
|
data-search-index="{{ $meili.indexUid }}"
|
||||||
data-search-api-key="{{ $apiKey }}"
|
data-search-api-key="{{ $meili.apiKey }}"
|
||||||
data-search-limit="{{ $meili.hitsPerPage }}"
|
data-search-limit="{{ $meili.hitsPerPage }}"
|
||||||
data-search-param="{{ $search.param }}"
|
data-search-param="{{ $search.param }}"
|
||||||
>
|
>
|
||||||
|
|||||||
6
test.sh
6
test.sh
@@ -18,8 +18,4 @@ detect_dev_host() {
|
|||||||
DEV_HOST="$(detect_dev_host)"
|
DEV_HOST="$(detect_dev_host)"
|
||||||
DEV_PORT=1313
|
DEV_PORT=1313
|
||||||
|
|
||||||
if [ -z "${MEILI_SEARCH_API_KEY+x}" ]; then
|
hugo server -DEF --bind "$DEV_HOST" --port $DEV_PORT --baseURL "http://$DEV_HOST:$DEV_PORT"
|
||||||
export MEILI_SEARCH_API_KEY="dummy"
|
|
||||||
fi
|
|
||||||
|
|
||||||
hugo server -DEF --bind "$DEV_HOST" --port $DEV_PORT --baseURL "http://$DEV_HOST:$DEV_PORT"
|
|
||||||
@@ -76,11 +76,7 @@
|
|||||||
{{- if gt $coverDisplay.Width 1480 -}}
|
{{- if gt $coverDisplay.Width 1480 -}}
|
||||||
{{- $coverWidth = 1480 -}}
|
{{- $coverWidth = 1480 -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $coverDisplay = partial "media/process-image.html" (dict
|
{{- $coverDisplay = $coverImage.Resize (printf "%dx webp q80" $coverWidth) -}}
|
||||||
"image" $coverImage
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" (printf "%dx" $coverWidth)
|
|
||||||
) -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -100,11 +100,7 @@
|
|||||||
{{- $title := default (printf "Image complémentaire : %s" $imageName) (index $data "title") -}}
|
{{- $title := default (printf "Image complémentaire : %s" $imageName) (index $data "title") -}}
|
||||||
{{- $thumbnail := . -}}
|
{{- $thumbnail := . -}}
|
||||||
{{- if and (ne .MediaType.SubType "svg") (gt .Width 360) -}}
|
{{- if and (ne .MediaType.SubType "svg") (gt .Width 360) -}}
|
||||||
{{- $thumbnail = partial "media/process-image.html" (dict
|
{{- $thumbnail = .Resize "360x webp q80" -}}
|
||||||
"image" .
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" "360x"
|
|
||||||
) -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .RelPermalink }}" title="{{ $title }}">
|
<a href="{{ .RelPermalink }}" title="{{ $title }}">
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
{{- $thumbnailTransform = "900x506" -}}
|
{{- $thumbnailTransform = "900x506" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $thumbnailOptions := printf "%s webp q80" $thumbnailTransform -}}
|
||||||
|
|
||||||
{{- $coverPath := $page.Params.cover -}}
|
{{- $coverPath := $page.Params.cover -}}
|
||||||
{{- $image := false -}}
|
{{- $image := false -}}
|
||||||
{{- if $coverPath -}}
|
{{- if $coverPath -}}
|
||||||
@@ -109,11 +111,7 @@
|
|||||||
<a href="{{ $page.RelPermalink }}">
|
<a href="{{ $page.RelPermalink }}">
|
||||||
<figure>
|
<figure>
|
||||||
{{- with $image -}}
|
{{- with $image -}}
|
||||||
{{- $resized := partial "media/process-image.html" (dict
|
{{- $resized := .Fill $thumbnailOptions -}}
|
||||||
"image" .
|
|
||||||
"action" "Fill"
|
|
||||||
"spec" $thumbnailTransform
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</figure>
|
</figure>
|
||||||
@@ -129,11 +127,7 @@
|
|||||||
<a href="{{ $page.RelPermalink }}">
|
<a href="{{ $page.RelPermalink }}">
|
||||||
<figure>
|
<figure>
|
||||||
{{- with $image -}}
|
{{- with $image -}}
|
||||||
{{- $resized := partial "media/process-image.html" (dict
|
{{- $resized := .Fill $thumbnailOptions -}}
|
||||||
"image" .
|
|
||||||
"action" "Fill"
|
|
||||||
"spec" $thumbnailTransform
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</figure>
|
</figure>
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
{{ partial "head/metadata.html" . }}
|
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||||
|
{{ with .Description }}
|
||||||
|
<meta name="description" content="{{ . }}">
|
||||||
|
{{ else }}
|
||||||
|
{{ with site.Params.description }}
|
||||||
|
<meta name="description" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
<link rel="icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon">
|
<link rel="icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon">
|
||||||
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon">
|
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon">
|
||||||
<link rel="icon" href="{{ "favicon.png" | absURL }}" type="image/png" sizes="256x256">
|
<link rel="icon" href="{{ "favicon.png" | absURL }}" type="image/png" sizes="256x256">
|
||||||
|
|||||||
@@ -15,21 +15,13 @@
|
|||||||
{{- if gt $image.Width $maxWidth -}}
|
{{- if gt $image.Width $maxWidth -}}
|
||||||
{{- $targetWidth = $maxWidth -}}
|
{{- $targetWidth = $maxWidth -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $display = partial "media/process-image.html" (dict
|
{{- $display = $image.Resize (printf "%dx webp q80" $targetWidth) -}}
|
||||||
"image" $image
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" (printf "%dx" $targetWidth)
|
|
||||||
) -}}
|
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $targetHeight := $image.Height -}}
|
{{- $targetHeight := $image.Height -}}
|
||||||
{{- if gt $image.Height 900 -}}
|
{{- if gt $image.Height 900 -}}
|
||||||
{{- $targetHeight = 900 -}}
|
{{- $targetHeight = 900 -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $display = partial "media/process-image.html" (dict
|
{{- $display = $image.Resize (printf "x%d webp q80" $targetHeight) -}}
|
||||||
"image" $image
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" (printf "x%d" $targetHeight)
|
|
||||||
) -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
{{/* Préserve les GIF animés en évitant toute transformation Hugo. */}}
|
|
||||||
{{- $image := .image -}}
|
|
||||||
{{- if not $image -}}
|
|
||||||
{{- errorf "media/process-image.html: missing image resource" -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- $action := .action -}}
|
|
||||||
{{- if not $action -}}
|
|
||||||
{{- errorf "media/process-image.html: missing image action for %q" $image.Name -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- $spec := .spec -}}
|
|
||||||
{{- if not $spec -}}
|
|
||||||
{{- errorf "media/process-image.html: missing image spec for %q" $image.Name -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- $result := $image -}}
|
|
||||||
{{- $subType := lower $image.MediaType.SubType -}}
|
|
||||||
{{- if and (ne $subType "svg") (ne $subType "gif") -}}
|
|
||||||
{{- $options := printf "%s webp q80" $spec -}}
|
|
||||||
{{- if eq $action "Fill" -}}
|
|
||||||
{{- $result = $image.Fill $options -}}
|
|
||||||
{{- else if eq $action "Resize" -}}
|
|
||||||
{{- $result = $image.Resize $options -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- errorf "media/process-image.html: unsupported image action %q for %q" $action $image.Name -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- return $result -}}
|
|
||||||
@@ -4,11 +4,7 @@
|
|||||||
{{- $assetPath := "images/oeuvres/l-anankeisme.png" -}}
|
{{- $assetPath := "images/oeuvres/l-anankeisme.png" -}}
|
||||||
{{- $source := resources.Get $assetPath -}}
|
{{- $source := resources.Get $assetPath -}}
|
||||||
{{- if $source -}}
|
{{- if $source -}}
|
||||||
{{- $img := partial "media/process-image.html" (dict
|
{{- $img := $source.Resize "320x webp q80" -}}
|
||||||
"image" $source
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" "320x"
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}" alt="Couverture de L'Anankéisme" loading="lazy">
|
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}" alt="Couverture de L'Anankéisme" loading="lazy">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</figure>
|
</figure>
|
||||||
|
|||||||
@@ -4,11 +4,7 @@
|
|||||||
{{- $assetPath := "images/oeuvres/l-humain-cette-espece-primitive.jpeg" -}}
|
{{- $assetPath := "images/oeuvres/l-humain-cette-espece-primitive.jpeg" -}}
|
||||||
{{- $source := resources.Get $assetPath -}}
|
{{- $source := resources.Get $assetPath -}}
|
||||||
{{- if $source -}}
|
{{- if $source -}}
|
||||||
{{- $img := partial "media/process-image.html" (dict
|
{{- $img := $source.Resize "320x webp q80" -}}
|
||||||
"image" $source
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" "320x"
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}" alt="Couverture de L'Humain, cette espèce primitive" loading="lazy">
|
<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}" alt="Couverture de L'Humain, cette espèce primitive" loading="lazy">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</figure>
|
</figure>
|
||||||
|
|||||||
@@ -6,11 +6,7 @@
|
|||||||
{{- $logo := resources.GetMatch $logoPath -}}
|
{{- $logo := resources.GetMatch $logoPath -}}
|
||||||
<a href="{{ "/" | relURL }}" aria-label="Revenir à l'accueil">
|
<a href="{{ "/" | relURL }}" aria-label="Revenir à l'accueil">
|
||||||
{{- with $logo -}}
|
{{- with $logo -}}
|
||||||
{{- $resized := partial "media/process-image.html" (dict
|
{{- $resized := .Resize "64x webp q80" -}}
|
||||||
"image" .
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" "64x"
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $resized.RelPermalink }}" alt="">
|
<img src="{{ $resized.RelPermalink }}" alt="">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<strong>{{ $site.Title }}</strong>
|
<strong>{{ $site.Title }}</strong>
|
||||||
|
|||||||
@@ -36,11 +36,7 @@
|
|||||||
{{- with $image -}}
|
{{- with $image -}}
|
||||||
<a href="{{ $page.RelPermalink }}">
|
<a href="{{ $page.RelPermalink }}">
|
||||||
<figure>
|
<figure>
|
||||||
{{- $resized := partial "media/process-image.html" (dict
|
{{- $resized := .Fill "600x340 webp q80" -}}
|
||||||
"image" .
|
|
||||||
"action" "Fill"
|
|
||||||
"spec" "600x340"
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
||||||
</figure>
|
</figure>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -315,11 +315,7 @@
|
|||||||
<a href="{{ $page.RelPermalink }}">
|
<a href="{{ $page.RelPermalink }}">
|
||||||
<figure>
|
<figure>
|
||||||
{{- with $image -}}
|
{{- with $image -}}
|
||||||
{{- $resized := partial "media/process-image.html" (dict
|
{{- $resized := .Fill "166x91 webp q80" -}}
|
||||||
"image" .
|
|
||||||
"action" "Fill"
|
|
||||||
"spec" "166x91"
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $resized.RelPermalink }}" alt="Capture du lien {{ $page.Title }}" loading="lazy">
|
<img src="{{ $resized.RelPermalink }}" alt="Capture du lien {{ $page.Title }}" loading="lazy">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</figure>
|
</figure>
|
||||||
@@ -405,11 +401,7 @@
|
|||||||
<a href="{{ $item.RelPermalink }}" title="{{ $item.Title }}">
|
<a href="{{ $item.RelPermalink }}" title="{{ $item.Title }}">
|
||||||
<figure>
|
<figure>
|
||||||
{{- with $itemImage -}}
|
{{- with $itemImage -}}
|
||||||
{{- $resized := partial "media/process-image.html" (dict
|
{{- $resized := .Resize "x128 webp q80" -}}
|
||||||
"image" .
|
|
||||||
"action" "Resize"
|
|
||||||
"spec" "x128"
|
|
||||||
) -}}
|
|
||||||
<img src="{{ $resized.RelPermalink }}" alt="{{ $item.Title }}" title="{{ $item.Title }}" loading="lazy">
|
<img src="{{ $resized.RelPermalink }}" alt="{{ $item.Title }}" title="{{ $item.Title }}" loading="lazy">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</figure>
|
</figure>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
{{ partial "head/metadata.html" . }}
|
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||||
<link rel="icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon" />
|
<link rel="icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon" />
|
||||||
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon" />
|
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}" type="image/x-icon" />
|
||||||
<link rel="icon" href="{{ "favicon.png" | absURL }}" type="image/png" sizes="256x256" />
|
<link rel="icon" href="{{ "favicon.png" | absURL }}" type="image/png" sizes="256x256" />
|
||||||
|
|||||||
Reference in New Issue
Block a user