refactor: update content structure and layout templates

- Updated author format in content files
- Added section field to content files
- Simplified categories format
- Removed no-category.html layout
- Updated list.html and single.html layouts
- Updated index.html layout
- Updated generate-content.js script
- Do not index content with git
This commit is contained in:
kbe
2025-08-18 17:41:33 +02:00
parent 2135420573
commit fced4930c1
267 changed files with 805 additions and 584 deletions

View File

@@ -8,7 +8,7 @@
<div class="post-meta">
<time>{{ .Date.Format "Jan 2, 2006" }}</time>
{{ if .Params.author }}
<span>{{ .Params.author.name }}</span>
<span>{{ .Params.author }}</span>
{{ end }}
</div>
{{ if .Params.excerpt }}

View File

@@ -1,31 +0,0 @@
{{ define "main" }}
<article class="post">
<header class="post-header">
<h1 class="post-title">{{ .Title }}</h1>
<div class="post-meta">
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time>
{{ if .Params.author }}
<span class="post-author">{{ .Params.author.name }}</span>
{{ end }}
<div class="post-categories">
<a href="/categories/general" class="category">General</a>
</div>
</div>
{{ if .Params.featured_image }}
<img src="{{ .Params.featured_image }}" alt="{{ .Title }}" class="featured-image">
{{ end }}
</header>
<div class="post-content">
{{ .Content }}
</div>
{{ if .Params.tags }}
<div class="post-tags">
{{ range .Params.tags }}
<a href="/tags/{{ .slug }}" class="tag">#{{ .name }}</a>
{{ end }}
</div>
{{ end }}
</article>
{{ end }}

View File

@@ -1,17 +1,20 @@
{{ define "main" }}
{{ if .Params.categories }}
<article class="post">
<header class="post-header">
<h1 class="post-title">{{ .Title }}</h1>
<div class="post-meta">
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time>
{{ if .Params.author }}
<span class="post-author">{{ .Params.author.name }}</span>
<span class="post-author">{{ .Params.author }}</span>
{{ end }}
<div class="post-categories">
{{ range .Params.categories }}
<a href="/categories/{{ .slug }}" class="category">{{ .name }}</a>
{{ with .Params.categories }}
{{ range . }}
<a href="/categories/{{ . | urlize }}" class="category">{{ . }}</a>
{{ end }}
{{ else }}
<a href="/categories/non-classe" class="category">Non classé</a>
{{ end }}
</div>
</div>
@@ -27,12 +30,9 @@
{{ if .Params.tags }}
<div class="post-tags">
{{ range .Params.tags }}
<a href="/tags/{{ .slug }}" class="tag">#{{ .name }}</a>
<a href="/tags/{{ . | urlize }}" class="tag">#{{ . }}</a>
{{ end }}
</div>
{{ end }}
</article>
{{ else }}
{{ partial "no-category.html" . }}
{{ end }}
{{ end }}

View File

@@ -1,4 +1,6 @@
{{ define "main" }}
{{ $defaultCategory := "General" }}
{{ if .Site.Params.defaultCategory }}{{ $defaultCategory = .Site.Params.defaultCategory }}{{ end }}
<div class="section-sm bg-gray-lighter">
<div class="container text-center">
<h3 class="font-family-playfair">{{ .Site.Title }} blog.</h3>
@@ -16,8 +18,8 @@
<div class="mb-5">
<div class="img-link-box">
<a href="{{ .Permalink }}">
{{ if .Params.image }}
<img src="{{ .Params.image }}" alt="{{ .Title }}">
{{ if .Params.featured_image }}
<img src="{{ .Params.featured_image }}" alt="{{ .Title }}">
{{ else }}
<img src="/assets/images/col-1.jpg" alt="{{ .Title }}">
{{ end }}
@@ -35,14 +37,14 @@
{{ if $category.name }}
<a class="font-family-poppins font-small fw-medium uppercase" href="/categories/{{ $category.name | urlize }}">{{ $category.name }}</a>
{{ else }}
<a class="font-family-poppins font-small fw-medium uppercase" href="#">General</a>
<a class="font-family-poppins font-small fw-medium uppercase" href="#">{{ $defaultCategory }}</a>
{{ end }}
{{ else }}
<a class="font-family-poppins font-small fw-medium uppercase" href="#">General</a>
<a class="font-family-poppins font-small fw-medium uppercase" href="#">{{ $defaultCategory }}</a>
{{ end }}
{{ end }}
{{ else }}
<a class="font-family-poppins font-small fw-medium uppercase" href="#">General</a>
<a class="font-family-poppins font-small fw-medium uppercase" href="#">{{ $defaultCategory }}</a>
{{ end }}
</div>
<div class="d-inline-flex">