Compare commits

...

6 Commits

8 changed files with 2648 additions and 48 deletions

View File

@ -1,11 +1,17 @@
{{/*
S'il n'y a pas de / dans l'url d'une image alors on ajoute le path de l'article
*/}}
{{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.File.Dir .Destination) }}
{{ if ne (substr $path -3 3) "svg" }}
{{ $image := .Page.Resources.GetMatch (printf "*%s*" .Destination) }}
{{ with $image }}
{{ $resizeParams := delimit (slice (default "610x" site.Params.ImageSize) (default "q100" site.Params.ImageQuality) (default "webp" site.Params.ImageFormat)) " " }}
{{ $resized := $image.Resize (string $resizeParams) }}
{{ $path = $resized.RelPermalink }}
{{ $maxWidth := (default "610" site.Params.ImageWidth) }}
{{ if gt $image.Width $maxWidth }}
{{ $resizeParams := delimit (slice (default "610x" site.Params.ImageSize) (default "q100" site.Params.ImageQuality) (default "webp" site.Params.ImageFormat)) " " }}
{{ $resized := $image.Resize (string $resizeParams) }}
{{ $path = $resized.RelPermalink }}
{{ end }}
{{ end }}
{{ end }}
<img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} loading="lazy" />

View File

@ -0,0 +1,3 @@
{
"data" : {{ block "response" .}}{{ end }}
}

View File

@ -0,0 +1,4 @@
{
"name": "{{ .Title }}",
"permalink" : "{{ .Permalink }}"
}

View File

@ -0,0 +1,7 @@
{{ define "response" }}
[
{{ range $index, $e := .Data.Pages }}
{{ if $index }}, {{ end }}{{ .Render "item" }}
{{ end }}
]
{{ end }}

View File

@ -0,0 +1 @@
{{ define "response" }} {{ .Render "item" }} {{ end }}

View File

@ -0,0 +1,4 @@
{{ if or (eq hugo.Environment "production") (eq hugo.Environment "staging") }}
<script async defer data-api="/api/event" data-domain="{{ (urls.Parse .Site.BaseURL).Host }}" src="/js/script.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
{{ end }}

2663
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
"author": "Simon <simon@lamelio.fr>",
"license": "GPL-3.0",
"dependencies": {
"@resilien/directus-to-markdown": "1.0.1",
"@resilien/directus-to-markdown": "1.2.0",
"imagemin-cli": "^6.0.0",
"imagemin-webp": "^6.0.0",
"richtypo": "4.1.9",