feat: implement micro and photos partials for Bridgy integration; refactor HTML structure

This commit is contained in:
Fundor333
2025-09-08 01:04:44 +02:00
parent 89126d1a7a
commit 0b5b684dad
4 changed files with 19 additions and 32 deletions

View File

@@ -3,32 +3,9 @@
{{ end }}
<div style="display: none;" class="p-summary {{ range .Site.Params.bridgy }}e-bridgy-{{.}}-content {{ end }}">
{{ if ne .Type "micro"}}{{ .Description }}{{ end }}
{{ if eq .Type "micro"}}{{ partial "bridgy/micro.html" . }}{{ end }}
{{ if eq .Type "photos"}}{{ partial "bridgy/photos.html" . }}{{ end }}
{{ if ne .Type "micro"}}
{{ .Description }}
{{ end }}
{{ if eq .Type "micro"}}
{{ .Content }}
{{ end }}
{{ if eq .Type "photos"}}
{{ .Content }}
{{ end }}
{{ with .Resources.ByType "image" }}
{{ range . }}
{{ $image := . }}
{{ if $image }}
<img loading="lazy" class="u-photo" src="{{ $image.Permalink }}" alt="{{ $.Description }}">
{{ end }}
{{ end }}
{{ end }}
{{ range .Params.tags }}
<div class="p-category">#{{ . }}</div>
{{ end }}
{{ range .Params.categories }}
<div class="p-category">#{{ . }}</div>
{{ end }}
{{ range .Params.tags }} <span class="p-category">#{{ . }}</span>{{ end }} {{ range .Params.categories }} <span class="p-category">#{{ . }}</span>{{ end }}
</div>

View File

@@ -0,0 +1 @@
{{ .Content }}

View File

@@ -0,0 +1,9 @@
{{ .Content }}
{{ with .Resources.ByType "image" }}
{{ range . }}
{{ $image := . }}
{{ if $image }}
<img loading="lazy" class="u-photo" src="{{ $image.Permalink }}" alt="{{ $.Description }}">
{{ end }}
{{ end }}
{{ end }}

View File

@@ -36,13 +36,13 @@ send_webmention: ## Send webmention from feed
@uv run python send_webmention.py
develop: ## Run the site localy
@hugo server --minify --disableFastRender --renderToMemory
@hugo server --disableFastRender --renderToMemory
developfuture: ## Run the site localy with all the future article
@hugo server --minify --disableFastRender --buildFuture --renderToMemory
@hugo server --disableFastRender --buildFuture --renderToMemory
developall: ## Run the site localy with all the article, future or drafts
@hugo server --minify --disableFastRender --buildFuture --buildDrafts --renderToMemory
@hugo server --disableFastRender --buildFuture --buildDrafts --renderToMemory
.PHONY: hydra
hydra: ## Check links