Compare commits
6 Commits
64eaab93b2
...
master
Author | SHA1 | Date | |
---|---|---|---|
81c863689e | |||
d5c0ebda14 | |||
c06ff39ffe | |||
cdb7e47a88 | |||
7dd4dbfd3c | |||
e0b3ed9a0f |
@ -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" />
|
||||
|
3
layouts/_default/baseof.json
Normal file
3
layouts/_default/baseof.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"data" : {{ block "response" .}}{{ end }}
|
||||
}
|
4
layouts/_default/item.json.json
Normal file
4
layouts/_default/item.json.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "{{ .Title }}",
|
||||
"permalink" : "{{ .Permalink }}"
|
||||
}
|
7
layouts/_default/list.json.json
Normal file
7
layouts/_default/list.json.json
Normal file
@ -0,0 +1,7 @@
|
||||
{{ define "response" }}
|
||||
[
|
||||
{{ range $index, $e := .Data.Pages }}
|
||||
{{ if $index }}, {{ end }}{{ .Render "item" }}
|
||||
{{ end }}
|
||||
]
|
||||
{{ end }}
|
1
layouts/_default/single.json.json
Normal file
1
layouts/_default/single.json.json
Normal file
@ -0,0 +1 @@
|
||||
{{ define "response" }} {{ .Render "item" }} {{ end }}
|
4
layouts/partials/plausible.html
Normal file
4
layouts/partials/plausible.html
Normal 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
2663
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
Reference in New Issue
Block a user