fix date format, better tags and posts list
Marco Andronaco andronacomarco@gmail.com
Sat, 14 Jan 2023 08:56:56 +0100
4 files changed,
24 insertions(+),
4 deletions(-)
M
assets/css/main.css
→
assets/css/main.css
@@ -331,3 +331,18 @@ table td{
padding: 6px 13px; border: 1px solid #dfe2e5; } + +/* CUSTOM CSS */ + +.post { + margin:10px; +} + +.tag { + border-bottom: none; +} + +.tag:hover { + background-color: transparent; + color: #999; +}
M
layouts/_default/list.html
→
layouts/_default/list.html
@@ -4,14 +4,19 @@ <h1>Entries tagged - "{{ .Data.Term }}"</h1>
{{ else }} <h1 class="page-title">All articles</h1> {{ end }} - <ul class="posts"> {{- range .Data.Pages -}} {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}} <li class="post"> - <a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span> + <span class="meta">{{ dateFormat "2006-01-02" .Date }}</span> + <a href="{{ .RelPermalink }}">{{.Title}}</a> + <span class="meta"> + {{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }} + {{ range (.GetTerms "tags") }}[<a href="{{ .Permalink }}" class="tag">{{ .LinkTitle }}</a>] {{ end }} + </span> </li> {{- end -}} {{- end -}} </ul> +<p><a href="/tags">Show all tags.</a> </p> {{ end }}
M
layouts/_default/single.html
→
layouts/_default/single.html
@@ -4,7 +4,7 @@ <article>
<div class="title"> <h1 class="title">{{ .Title }}</h1> {{ if isset .Params "date" }} - <div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div> + <div class="meta">Posted {{ dateFormat "2006-01-02" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div> {{ end }} </div> {{ if isset .Params "tldr" }}
M
layouts/_default/terms.html
→
layouts/_default/terms.html
@@ -13,7 +13,7 @@ <ul class="tags">
{{ range $key, $value := .Data.Terms.ByCount }} {{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }} {{ $size := (cond (eq $biggest $smallest) $min $size) }} - <li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li> + <li class="post"><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li> {{ end }} </ul> </div>