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 }}