diff options
-rwxr-xr-x | exampleSite/config.toml | 6 | ||||
-rwxr-xr-x | layouts/_default/li.html | 3 | ||||
-rw-r--r-- | layouts/partials/modified_date.html | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3f41391..49fba7c 100755 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -7,10 +7,16 @@ copyright = "© Copyright notice" # Google Analytics API key. googleAnalytics = "Your Google Analytics tracking id" +# enable get info from git commits, such as file modification time. +# so we don't have to manually update it. +enableGitInfo = true + [params] paginate = 10 # Hide the date on posts # hideDate = true + # Hide last modified date on posts + # hideModifiedDate = true # Hide the word count on posts and in the posts list # hideWordCount = true # Hide the reading time on posts and in the posts list diff --git a/layouts/_default/li.html b/layouts/_default/li.html index 7e3c953..de23d6c 100755 --- a/layouts/_default/li.html +++ b/layouts/_default/li.html @@ -3,6 +3,9 @@ <h2 class="c-title c-article__title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2> <p class="c-article__meta"> {{ partial "timestamp.html" . }} + {{ if not (.Param "hideModifiedDate") }} + | {{ partial "modified_date.html" . }} + {{ end }} {{ if not (.Param "hideWordCount") }} | {{ partial "word_count.html" . }} {{ end }} diff --git a/layouts/partials/modified_date.html b/layouts/partials/modified_date.html new file mode 100644 index 0000000..76802a9 --- /dev/null +++ b/layouts/partials/modified_date.html @@ -0,0 +1,4 @@ +Updated on +<time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}"> + {{ .Lastmod.Format "Jan 2, 2006" }} +</time> |