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:
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
Reference in New Issue
Block a user