Use info from git for author, date and first header of markdown
file for page title.
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ range (where $pages "Section" "!=" "") }}
<li>
- <span class="date">{{ .Date.Format "2006/01/02" }}</span>
- <a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
+ <span class="date">{{ .GitInfo.AuthorDate.Format "2006/01/02" }}</span>
+ <a href="{{ .RelPermalink }}">{{ .MarkdownTitleInfo.Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{ partial "header.html" . }}
<div class="article-meta">
-<h1><span class="title">{{ .Title | markdownify }}</span></h1>
-{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
-{{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }}
+<h1><span class="title">{{ .MarkdownTitleInfo.Title | markdownify }}</span></h1>
+<h2 class="author">{{ .GitInfo.AuthorName }} <{{ .GitInfo.AuthorEmail }}></h2>
+{{ if (gt .Params.date 0) }}<h2 class="date">{{ .GitInfo.AuthorDate.Format "2006/01/02" }}</h2>{{ end }}
</div>
<main>