add gallery imtags navigation

This commit is contained in:
Matthieu Bessat 2022-09-29 00:29:47 +02:00
parent 325875a5c7
commit 5fc2e809cf
29 changed files with 92 additions and 84 deletions

View file

@ -4,7 +4,7 @@ defaultContentLanguage = 'fr'
title = "L'Étoile de Bethléem" title = "L'Étoile de Bethléem"
[taxonomies] [taxonomies]
image-tag = 'image-tags' imtag = 'imtags'
# theme = "custom" # theme = "custom"

View file

@ -2,7 +2,7 @@
title: Autel principal title: Autel principal
original_name: L'autel à l'intérieur.jpg original_name: L'autel à l'intérieur.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- autel-principal - autel-principal
--- ---

View file

@ -2,7 +2,7 @@
title: Avant de la crypte title: Avant de la crypte
original_name: crypte_carte_postale.jpg original_name: crypte_carte_postale.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
--- ---

View file

@ -2,7 +2,7 @@
title: Ensemble mangeoir, étable title: Ensemble mangeoir, étable
original_name: etable.jpg original_name: etable.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- mangeoir - mangeoir
# etable # etable

View file

@ -2,7 +2,7 @@
title: Entrée de la crypte en 1896 title: Entrée de la crypte en 1896
original_name: Aubevoye_-_Bethléem_-_entrée_de_la_crypte_-_1896.jpg original_name: Aubevoye_-_Bethléem_-_entrée_de_la_crypte_-_1896.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- entrée-crypte - entrée-crypte
inception: 1896 inception: 1896

View file

@ -2,6 +2,6 @@
title: La vierge éclairée title: La vierge éclairée
original_name: 935_001.jpg original_name: 935_001.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'loge-vierge'] imtags: ['crypte', 'loge-vierge']
--- ---

View file

@ -2,6 +2,6 @@
title: Ensemble crypte title: Ensemble crypte
original_name: 47FI3.jpg original_name: 47FI3.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'ensemble-crypte'] imtags: ['crypte', 'ensemble-crypte']
--- ---

BIN
content/images/14/original.jpg Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View file

@ -2,6 +2,6 @@
title: Mangeoir, Étable title: Mangeoir, Étable
original_name: 629_001.jpg original_name: 629_001.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'mangeoir'] imtags: ['crypte', 'mangeoir']
--- ---

View file

@ -2,6 +2,6 @@
title: Mangeoir, étable title: Mangeoir, étable
original_name: 865_001.jpg original_name: 865_001.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'mangeoir'] imtags: ['crypte', 'mangeoir']
--- ---

View file

@ -2,7 +2,7 @@
title: Dessin de l'entrée de la crypte title: Dessin de l'entrée de la crypte
original_name: Bethleem-pot-crypte.jpg original_name: Bethleem-pot-crypte.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- entrée-crypte - entrée-crypte
--- ---

View file

@ -2,7 +2,7 @@
title: Le plafond de la grotte avec ses lampes title: Le plafond de la grotte avec ses lampes
original_name: Le plafond de la grotte avec ses lampes.jpg original_name: Le plafond de la grotte avec ses lampes.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: image_imtags:
- crypte - crypte
- lampes - lampes
- ensemble-crypte - ensemble-crypte

View file

@ -2,7 +2,7 @@
title: Ensemble crypte title: Ensemble crypte
original_name: Aubevoye_-_Bethléem_-_la_crypte_en_1896.jpg original_name: Aubevoye_-_Bethléem_-_la_crypte_en_1896.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- ensemble-crypte - ensemble-crypte
inception: 1896 inception: 1896

View file

@ -2,6 +2,6 @@
title: Entrée de la crypte aujourd'hui title: Entrée de la crypte aujourd'hui
original_name: entree-crypte-bethleem-2.jpg original_name: entree-crypte-bethleem-2.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'entrée-crypte'] imtags: ['crypte', 'entrée-crypte']
--- ---

View file

@ -2,7 +2,7 @@
title: Autel des rois mages title: Autel des rois mages
original_name: Une petite statue de la Vierge à l'intérieur de la grotte.jpg original_name: Une petite statue de la Vierge à l'intérieur de la grotte.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- autel-rois-mages - autel-rois-mages
--- ---

View file

@ -2,6 +2,6 @@
title: Statue de la Vierge title: Statue de la Vierge
original_name: WhatsApp Image 2022-01-14 at 14.04.04.jpeg original_name: WhatsApp Image 2022-01-14 at 14.04.04.jpeg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'loge-vierge'] imtags: ['crypte', 'loge-vierge']
--- ---

View file

@ -2,7 +2,7 @@
title: Dalle de la crypte cassée title: Dalle de la crypte cassée
original_name: dalle-crypte-bethleem1.jpg original_name: dalle-crypte-bethleem1.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- etoile - etoile
--- ---

View file

@ -2,7 +2,7 @@
title: Entrée de la crypte title: Entrée de la crypte
original_name: entree-crypte-bethleem-11.jpg original_name: entree-crypte-bethleem-11.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'entrée-crypte'] imtags: ['crypte', 'entrée-crypte']
--- ---

View file

@ -2,7 +2,7 @@
title: Ensemble crypte title: Ensemble crypte
original_name: WhatsApp Image 2022-01-14 at 14.03.06.jpeg original_name: WhatsApp Image 2022-01-14 at 14.03.06.jpeg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'ensemble-crypte'] imtags: ['crypte', 'ensemble-crypte']
inception: inception:
from: 1950 from: 1950
to: 2000 to: 2000

View file

@ -2,7 +2,7 @@
title: Mangeoir, étable title: Mangeoir, étable
original_name: WhatsApp Image 2022-01-14 at 14.05.16.jpeg original_name: WhatsApp Image 2022-01-14 at 14.05.16.jpeg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- mangeoir - mangeoir
--- ---

View file

@ -2,6 +2,6 @@
title: Mangeoir, étable title: Mangeoir, étable
original_name: Reproduction de la grotte de la nativité.jpg original_name: Reproduction de la grotte de la nativité.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: ['crypte', 'mangeoir'] imtags: ['crypte', 'mangeoir']
--- ---

View file

@ -2,7 +2,7 @@
title: Statue de la Vierge title: Statue de la Vierge
original_name: La statue de la Vierge à l'intérieur de la grotte.jpg original_name: La statue de la Vierge à l'intérieur de la grotte.jpg
mime_type: image/jpeg mime_type: image/jpeg
tags: imtags:
- crypte - crypte
- loge-vierge - loge-vierge
--- ---

View file

@ -15,12 +15,11 @@ for dir in images_dirs:
# change tags to image-tags # change tags to image-tags
path = CONTENT_DIR + dir + '/index.md' path = CONTENT_DIR + dir + '/index.md'
print(path) print(path)
index_file = open(path, 'w+') # index_file = open(path, 'w+')
# content = index_file.read()
content = index_file.read() # print(content)
print(content) # content = content.replace('tags:', 'image-tags:')
content = content.replace('tags:', 'image-tags:') # print(content)
print(content)
break break
index_file.write(content) index_file.write(content)
index_file.close() index_file.close()

View file

@ -1 +0,0 @@
Term page for image tag

View file

@ -1 +0,0 @@
List of images tags

View file

@ -1,55 +1,4 @@
{{ define "main" }} {{ define "main" }}
<main> {{ .Scratch.Set "image_list_context" "all" }}
{{ partial "images-list.html" . }}
<div class="gallery">
<div class="gallery__side">
{{ $listtitle := .Title }}
{{ if or .Title .Content }}
<div>
{{ with .Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Content }}<div>{{ . }}</div>{{ end }}
</div>
{{ end }}
<div class="gallery-tags__title">Filtrer par étiquettes</div>
<div class="gallery-tags__list">
<ul>
{{- range .Site.Taxonomies.tags -}}
<li>
<a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>
</li>
{{- end -}}
</ul>
</div>
</div>
<div class="gallery__items-container">
<div class="gallery__items">
{{ range (.Paginator 8).Pages }}
<a class="gallery__item" href="{{ .RelPermalink }}">
{{ $image := .Resources.GetMatch "original.jpg" }}
{{ $image := $image.Resize "x350" }}
{{ with $image }}
<img
class="gallery__image"
src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}"
/>
{{ end }}
{{/*
<div class="post-title">
{{ if eq $listtitle "Posts" }}
{{ .Date.Format "2006-01-02" }} <a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ else }}
<a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ end }}
</div>
*/}}
</a>
{{ end }}
</div>
{{ partial "pagination.html" . }}
</div>
</div>
</main>
{{ end }} {{ end }}

View file

@ -13,8 +13,8 @@
<path d="M6 9h-.01" /> <path d="M6 9h-.01" />
</svg> </svg>
<ul> <ul>
{{ range .Params.image_tags }} {{ range .Params.imtags }}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li> <li><a href="/tag_images/{{ . | urlize }}">{{ . }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
</div> </div>

4
layouts/imtags/term.html Normal file
View file

@ -0,0 +1,4 @@
{{ define "main" }}
{{ .Scratch.Set "image_list_context" "imtags" }}
{{ partial "images-list.html" . }}
{{ end }}

View file

@ -0,0 +1,58 @@
<main>
<div class="gallery">
<div class="gallery__side">
{{ $listtitle := .Title }}
{{ if or .Title .Content }}
<div>
{{ with .Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Content }}<div>{{ . }}</div>{{ end }}
</div>
{{ end }}
<div class="gallery-tags__title">Filtrer par étiquettes</div>
<div class="gallery-tags__list">
<ul>
{{- if eq (.Scratch.Get "image_list_context") "imtags" -}}
<li>
<a href="/images">Tout</a>
</li>
{{- end -}}
{{- range .Site.Taxonomies.imtags -}}
<li>
<a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>
</li>
{{- end -}}
</ul>
</div>
</div>
<div class="gallery__items-container">
<div class="gallery__items">
{{ range (.Paginator 8).Pages }}
<a class="gallery__item" href="{{ .RelPermalink }}">
{{ $image := .Resources.GetMatch "original.jpg" }}
{{ $image := $image.Resize "x350" }}
{{ with $image }}
<img
class="gallery__image"
src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}"
/>
{{ end }}
{{/*
<div class="post-title">
{{ if eq $listtitle "Posts" }}
{{ .Date.Format "2006-01-02" }} <a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ else }}
<a href="{{ .RelPermalink }}">{{.Title }}</a>
{{ end }}
</div>
*/}}
</a>
{{ end }}
</div>
{{ partial "pagination.html" . }}
</div>
</div>
</main>