diff options
| author | Nantha Sorubakanthan <nantha@mielota.com> | 2025-09-21 17:32:32 +0200 |
|---|---|---|
| committer | Nantha Sorubakanthan <nantha@mielota.com> | 2025-09-21 17:32:32 +0200 |
| commit | df3d7d5734855f72b72bdb18bbf9e3599dec0156 (patch) | |
| tree | eb7111173c5bb3660505ea565e0f7e79d9c04274 /layouts | |
first commit
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/404.html | 13 | ||||
| -rwxr-xr-x | layouts/_default/_markup/render-image.html | 1 | ||||
| -rw-r--r-- | layouts/_default/baseof.html | 20 | ||||
| -rw-r--r-- | layouts/_default/home.html | 3 | ||||
| -rw-r--r-- | layouts/_default/list.html | 11 | ||||
| -rw-r--r-- | layouts/_default/single.html | 3 | ||||
| -rw-r--r-- | layouts/index.xml | 44 | ||||
| -rw-r--r-- | layouts/partials/buttons.html | 13 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 17 | ||||
| -rw-r--r-- | layouts/partials/head.html | 23 | ||||
| -rw-r--r-- | layouts/partials/header.html | 3 | ||||
| -rw-r--r-- | layouts/shortcodes/article-list.html | 6 |
12 files changed, 157 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..737d495 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html lang="{{ or site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}"> + +<head> + {{ partial "head.html" . }} +</head> + +<body class="notfound"> + <h1>404</h1> + <p>Tu t'es perdu(e) ? Reviens à la page <a href="/">d'accueil</a>.</p> +</body> + +</html> diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100755 index 0000000..0a338b6 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1 @@ +<img src="{{ .Page.Permalink }}{{ .Destination }}"{{ with .Text }} alt="{{ . | safeHTML }}" title="{{ . | safeHTML }}"{{- end -}}> diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..add4e17 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="{{ or site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}"> + +<head> + {{ partial "head.html" . }} +</head> + +<body> + <header> + {{ partial "header.html" . }} + </header> + <main> + {{ block "main" . }}{{ end }} + </main> + <footer> + {{ partial "footer.html" . }} + </footer> +</body> + +</html> diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..9983b08 --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,3 @@ +{{ define "main" }} +{{ .Content }} +{{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..a3eb9d3 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,11 @@ +{{ define "main" }} +{{ .Content }} + +<div class="columns"> + <ul> + {{ range .Pages }} + <li>{{ .Date.Format "02/01/06" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ end }} + </ul> +</div> +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..366e181 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,3 @@ +{{ define "main" }} +{{- .Content }} +{{ end }} diff --git a/layouts/index.xml b/layouts/index.xml new file mode 100644 index 0000000..3af797c --- /dev/null +++ b/layouts/index.xml @@ -0,0 +1,44 @@ +{{- $authorEmail := .Site.Params.email }} + +{{- $authorName := .Site.Params.name }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>{{ .Site.Title }}</description> + <author>{{ $authorEmail }} ({{ $authorName }})</author> + <generator>Hugo</generator> + <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }} + <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }} + <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + <item> + <title>{{ .Title }}</title>{{ $title := .Title }} + <link>{{ .Permalink }}</link> + <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }} + <guid>{{ .Permalink }}</guid> + {{- $emailprompt := "" }} + {{- with .Site.Params.links.email }}{{ $emailprompt = printf "<a href=\"%s?subject=RE: %s\">← Reply-To</a>" . $title }}{{ end }} + <description>{{ ((printf "%s%s" .Content $emailprompt) | transform.XMLEscape) | safeHTML }}</description> + </item> + {{- end }} + </channel> +</rss> diff --git a/layouts/partials/buttons.html b/layouts/partials/buttons.html new file mode 100644 index 0000000..7eab99d --- /dev/null +++ b/layouts/partials/buttons.html @@ -0,0 +1,13 @@ +<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> + <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> + +</div> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..18bc220 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,17 @@ +{{- $isregular := (in .Site.RegularPages .Page) -}} + +{{- if $isregular }} +{{- $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 }} + <time datetime="{{ $dateMachine }}">{{ .Date.Format "02/01/2006" }}</time> +</div> +{{- end -}} + +<hr> +<nav> + {{- $title := .Title -}} + <p> + {{ partial "buttons.html" . }} +</nav> diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..477643d --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,23 @@ +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width"> +{{ with .Params.css }} +<link rel="stylesheet" href="{{ . }}"> +{{- else -}} +<link rel="stylesheet" href="/style.css"> +{{- with .Section }} +<link rel="stylesheet" href="/{{ . }}/{{ . }}.css"> +{{- end }} +{{- end }} +<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }}{{ end }}</title> +<meta name="author" content="{{ .Site.Params.email }} ({{ .Site.Params.name }})"> +<meta name="description" content="{{- plainify (chomp .Summary) -}}"> +<!-- OpenGraph specification --> +<meta property="og:title" content="{{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }}{{ end }}" /> +<meta property="og:description" content="{{- plainify (chomp .Summary) -}}" /> +<meta property="og:url" content="{{ .Permalink}}" /> +{{- $images := .Page.Resources.ByType "image" }} +{{- with index $images 0 }} +{{- $processed := .Resize "600x" }} +{{- $processed := $processed.Crop "512x512" }} +<meta property="og:image" content="{{ $processed.RelPermalink }}" /> +{{- end -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..96f7542 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,3 @@ +<h1>{{ if .IsHome }}{{ site.Title }}</h1>{{ else }}{{ .Title }}</h1> +{{ end -}} +<hr> diff --git a/layouts/shortcodes/article-list.html b/layouts/shortcodes/article-list.html new file mode 100644 index 0000000..755b229 --- /dev/null +++ b/layouts/shortcodes/article-list.html @@ -0,0 +1,6 @@ +<ul> + {{- range where .Site.RegularPages "Type" (.Get "category") | first 7 }} + <li>{{ .Date.Format "02/01/06" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{- end }} + <li><i><a href="{{ .Get "category" }}">Plus...</a></i></li> +</ul> |
