Jacky Zhao
2022-07-15 e15e39155de54dc1624bab80eefbccd6a783cd0c
fix: give precedence to date created over last modified if defined (#101)
1 files added
3 files modified
12 ■■■■ changed files
content/_index.md 1 ●●●● patch | view | raw | blame | history
layouts/_default/single.html 2 ●●● patch | view | raw | blame | history
layouts/partials/date-fmt.html 7 ●●●●● patch | view | raw | blame | history
layouts/partials/page-list.html 2 ●●● patch | view | raw | blame | history
content/_index.md
@@ -24,3 +24,4 @@
- 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md)
- 🐛 [Submit an Issue](https://github.com/jackyzha0/quartz/issues)
- 👀 [Discord Community](https://discord.gg/cRFFHYye7t)
layouts/_default/single.html
@@ -10,7 +10,7 @@
    <article>
      {{if .Title}}<h1>{{ .Title }}</h1>{{end}}
      <p class="meta">
          Last updated {{if ne .Date .Lastmod}}{{ .Lastmod.Format "January 2, 2006" }}{{else}}Unknown{{end}}.
          Last updated {{ partial "date-fmt.html" .}}
          {{ partial "github.html" . }}
      </p>
      <ul class="tags">
layouts/partials/date-fmt.html
New file
@@ -0,0 +1,7 @@
{{if .Date}}
{{.Date.Format "Jan 2, 2006"}}
{{else if .Lastmod}}
{{.Lastmod.Format "Jan 2, 2006"}}
{{else}}
Unknown
{{end}}
layouts/partials/page-list.html
@@ -3,7 +3,7 @@
    <li class="section-li">
        <div class="section">
            <p class="meta">
                {{if ne .Date .Lastmod}}{{ .Lastmod.Format "January 2, 2006" }}{{else}}Unknown{{end}}
                {{partial "date-fmt.html" .}}
            </p>
            <div class="desc">
                <h3><a href="{{ .Permalink }}">{{- .Title -}}</a></h3>