diff options
| author | Nantha Sorubakanthan <nantha@mielota.com> | 2025-09-22 11:06:15 +0200 |
|---|---|---|
| committer | Nantha Sorubakanthan <nantha@mielota.com> | 2025-09-22 11:06:15 +0200 |
| commit | ef7c8c820916556fc5bff26c6ad7d12ef1606423 (patch) | |
| tree | e6dbc68e081d43c6675591e1748f489833c8c05d /layouts | |
| parent | c150f419a06e7bb006a4a71fa4e98faeb961037d (diff) | |
reworked the website
changed buttons, css, added first blog post
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/404.html | 2 | ||||
| -rwxr-xr-x | layouts/_default/_markup/render-image.html | 28 | ||||
| -rw-r--r-- | layouts/partials/buttons.html | 11 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 2 | ||||
| -rw-r--r-- | layouts/partials/header.html | 2 | ||||
| -rw-r--r-- | layouts/shortcodes/article-list.html | 4 |
6 files changed, 35 insertions, 14 deletions
diff --git a/layouts/404.html b/layouts/404.html index 737d495..081e509 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -7,7 +7,7 @@ <body class="notfound"> <h1>404</h1> - <p>Tu t'es perdu(e) ? Reviens à la page <a href="/">d'accueil</a>.</p> + <p>Where are you going bro ? Come back <a href="/">here</a>.</p> </body> </html> diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 0a338b6..9bd482e 100755 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1 +1,27 @@ -<img src="{{ .Page.Permalink }}{{ .Destination }}"{{ with .Text }} alt="{{ . | safeHTML }}" title="{{ . | safeHTML }}"{{- end -}}> +{{ $src := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) }} + +{{ if $src }} +<figure> + {{ $data := newScratch }} + + {{ if gt $src.Width 1100 }} + {{ $data.Set "webp" ($src.Resize "960x webp q90") }} + {{ $data.Set "fallback" ($src.Resize "960x q90") }} + {{ else }} + {{ $data.Set "webp" ($src.Resize (printf "%dx%d webp q90" $src.Width $src.Height)) }} + {{ $data.Set "fallback" ($src.Resize (printf "%dx%d q90" $src.Width $src.Height)) }} + {{ end }} + + {{ $webp := $data.Get "webp" }} + {{ $fallback := $data.Get "fallback" }} + + <a href="{{ $src }}"> + <picture> + <source srcset="{{ $webp.RelPermalink }}" type="image/webp"> + <img src="{{ $fallback.RelPermalink }}" alt="{{ .Text }}" loading="lazy" decoding="async" width="{{ $src.Width }}" + height="{{ $src.Height }}" /> + </picture> + </a> + {{ with .Title }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }} +</figure> +{{end}} diff --git a/layouts/partials/buttons.html b/layouts/partials/buttons.html index 7eab99d..beb7d9e 100644 --- a/layouts/partials/buttons.html +++ b/layouts/partials/buttons.html @@ -1,13 +1,8 @@ -<div style="text-align: center;"> - <a href="/"><img src="/favicon.ico" alt="Logo de mon site" - title="Page Web de Mielota" width="37" height="37"></a> - <a href="/index.xml"><img src="/assets/rss.png" alt="Rss Feed logo" - title="Rss Feed"></a> +<div class="buttons"> <a href="/banporn/"><img src="/assets/banporn.png" alt="BAN PORN" title="BAN PORN"></a> <a href="https://codeberg.org/mielota"><img src="/assets/codeberg.png" alt="Codeberg logo" title="Codeberg"></a> - <a href="https://github.com/mielota"><img src="/assets/github.png" alt="GitHub logo" - title="GitHub"></a> - + <a href="/"><img src="/favicon.ico" alt="Logo de mon site" + title="Page Web de Mielota" width="31" height="31"></a> </div> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 18bc220..08aa27c 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -4,7 +4,7 @@ {{- $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{ if .IsHome }}{{ else }} <div class="finaline"> - <p class="no-print"><a href="{{ path.Dir .Path }}">Revenir à l'accueil</a></p>{{ end }} + <p class="no-print"><a href="{{ path.Dir .Path }}">Return</a></p>{{ end }} <time datetime="{{ $dateMachine }}">{{ .Date.Format "02/01/2006" }}</time> </div> {{- end -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 96f7542..a26436e 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,3 +1,3 @@ <h1>{{ if .IsHome }}{{ site.Title }}</h1>{{ else }}{{ .Title }}</h1> {{ end -}} -<hr> +<br> diff --git a/layouts/shortcodes/article-list.html b/layouts/shortcodes/article-list.html index 755b229..a870eac 100644 --- a/layouts/shortcodes/article-list.html +++ b/layouts/shortcodes/article-list.html @@ -1,6 +1,6 @@ <ul> - {{- range where .Site.RegularPages "Type" (.Get "category") | first 7 }} + {{- range where .Site.RegularPages "Type" (.Get "category") | first (.Get "number") }} <li>{{ .Date.Format "02/01/06" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li> {{- end }} - <li><i><a href="{{ .Get "category" }}">Plus...</a></i></li> + <li><i><a href="{{ .Get "category" }}">See more...</a></i></li> </ul> |
