liz2020
2020-11-26 00:41:13 -05:00
parent 8f4225ea8f
commit 826529a5e2
4 changed files with 20 additions and 22 deletions

View File

@@ -69,6 +69,14 @@ abstraction show in the post page
other content other content
``` ```
## add last modified data
Unfortunately, hugo cannot automaticlly get files' modified date, and it needs to be manually set in page as `lastmode`.
```
---
lastmode: 2019-10-22T18:46:47+08:00
---
```
## Support LaTex ## Support LaTex
In you post add `katex:true` to [front matter](https://gohugo.io/content-management/front-matter/) In you post add `katex:true` to [front matter](https://gohugo.io/content-management/front-matter/)
``` ```

View File

@@ -46,10 +46,9 @@
{{ .Summary | safeHTML }} {{ .Summary | safeHTML }}
</div> </div>
<div class="f6 text-gray mt-2"> <div class="f6 text-gray mt-2">
Updated <relative-time datetime="{{ .PublishDate.Format "2006-01-02" }}" Updated <time-ago datetime="{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}" class="no-wrap">
class="no-wrap" title="Modify at {{ .Lastmod.Format "2006/01/02" }}"> Mon, 02 Jan 2006 15:04:05 -0700</time-ago>
{{ .PublishDate.Format "January 2, 2006" }}</relative-time> </div>
</div>
</div> </div>
</div> </div>
</li> </li>

View File

@@ -7,10 +7,9 @@
<h1 class="public css-truncate float-none flex-auto width-fit pl-0"> <h1 class="public css-truncate float-none flex-auto width-fit pl-0">
<a class="avatar mr-1" href="{{ absURL "about/" }}"> <a class="avatar mr-1" href="{{ absURL "about/" }}">
{{ with $.Site.Params.avatar }} {{ with $.Site.Params.avatar }}
<img src="{{ $.Site.Params.avatar }}" width="26" height="26">
<img src="{{ $.Site.Params.avatar }}" width="26" height="26">
{{ else }} {{ else }}
<img src="{{ "images/avatar.png" | absURL }}" width="26" height="26"> <img src="{{ "images/avatar.png" | absURL }}" width="26" height="26">
{{ end }} {{ end }}
</a> </a>
<span class="author"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author }}</a></span> <span class="author"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author }}</a></span>
@@ -19,21 +18,15 @@
href="{{ .Permalink }}">{{ .Title }}</a></strong> href="{{ .Permalink }}">{{ .Title }}</a></strong>
<div class="d-block text-small text-gray"> <div class="d-block text-small text-gray">
Created <time-ago datetime="{{ .Date.Format "2006-01-02" }}" class="no-wrap" Created <time-ago datetime="{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}" class="no-wrap">
title="Created at {{ .PublishDate.Format "2006/01/02" }}"> Mon, 02 Jan 2006 15:04:05 -0700</time-ago>
{{ .PublishDate.Format "2006-01-02" }}</time-ago>
<span class="file-info-divider"></span> <span class="file-info-divider"></span>
Modified <time-ago datetime="{{ .Lastmod.Format "2006-01-02" }}" class="no-wrap" Modified <time-ago datetime="{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}" class="no-wrap">
title="Modified at {{ .Lastmod.Format "2006/01/02" }}"> Mon, 02 Jan 2006 15:04:05 -0700</time-ago>
{{ .Lastmod.Format "2006-01-02" }}</time-ago>
</div> </div>
</h1> </h1>
</div> </div>
</div> </div>
</div> </div>
<div class="container-lg clearfix new-discussion-timeline experiment-repo-nav p-responsive"> <div class="container-lg clearfix new-discussion-timeline experiment-repo-nav p-responsive">
<div class="repository-content "> <div class="repository-content ">

View File

@@ -38,12 +38,10 @@
<div name="posts-post" class="text-gray mb-2 pr-4"> <div name="posts-post" class="text-gray mb-2 pr-4">
{{ .Summary | safeHTML }} {{ .Summary | safeHTML }}
</div> </div>
<div class="f6 text-gray mt-2"> <div class="f6 text-gray mt-2">
Updated <relative-time datetime="{{ .PublishDate.Format "2006-01-02" }}" class="no-wrap" Updated <time-ago datetime="{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}" class="no-wrap">
title="Modifyd at {{ .Lastmod.Format "2006/01/02" }}"> Mon, 02 Jan 2006 15:04:05 -0700</time-ago>
{{ .PublishDate.Format "January 2, 2006" }}</relative-time> </div>
</div>
</div> </div>
</li> </li>
{{ end }} {{ end }}