Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yihui/hugo-xmag.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYihui Xie <xie@yihui.name>2017-07-17 23:17:52 +0300
committerYihui Xie <xie@yihui.name>2017-07-17 23:17:52 +0300
commit024c52500db6b70a009d9e6bb3a600058b10be0b (patch)
treecfa348dd0abed4240d8300f66a1d0c99295a05c8
parent0afb82da537ec5abbea159900bc1011a988913f4 (diff)
ISO8601 date format, swap author and date in the list, and add a slash after the author name
-rw-r--r--layouts/_default/list.html4
-rw-r--r--layouts/partials/header.html4
2 files changed, 4 insertions, 4 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index cad7dc9..4016581 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -16,8 +16,8 @@
</div>
<h1><a href="{{ .URL }}">{{ .Title }}</a></h1>
<div class="date-author">
- <span class="date">{{ .Date.Format "2006/01/02" }}</span>
- {{ with .Params.author }}<span class="author">{{ . }}</span>{{ end }}
+ {{ with .Params.author }}<span class="author">{{ . }}</span> / {{ end }}
+ <span class="date">{{ .Date.Format "2006-01-02" }}</span>
</div>
<div class="summary">
<a href="{{ .URL }}">
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 7b4a004..0a79efc 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -16,7 +16,7 @@
<div class="head-meta">
{{ if .IsPage }}
<span><a href="{{ relURL .Site.BaseURL }}">{{ (default "Back to Home" .Site.Params.text.back) | safeHTML }}</a></span>
- {{ if .Params.date }}<span class="date">{{ .Date.Format "2006/01/02" }}</span>{{ end }}
+ {{ if .Params.date }}<span class="date">{{ .Date.Format "2006-01-02" }}</span>{{ end }}
{{ if .File.Path }}
{{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
{{ if (where (readDir (print "content/" .File.Dir)) "Name" $RmdFile) }}
@@ -30,7 +30,7 @@
{{ end }}
{{ else }}
<span>{{ $.Scratch.Get "Title" }}</span>
- <span>{{ now.Format "2006/01/02" }}</span>
+ <span>{{ now.Format "2006-01-02" }}</span>
{{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
<span>{{ with $paginator }}{{ if .TotalPages }}{{ .PageNumber }} / {{ .TotalPages }}{{ end }}{{ end }}</span>
{{ end }}