feature: hidding date in the home page

This commit is contained in:
Mivinci 2021-10-29 00:01:17 +08:00
parent abfdf50d6f
commit 125a569697
2 changed files with 5 additions and 1 deletions

View file

@ -16,7 +16,7 @@ theme = "hugo-theme-minima"
[author] [author]
name = "XJJ" name = "XJJ"
slogon = "A student and web developer from Earth 🌍" slogon = "A student and web developer from Earth 🌍"
description = "This is Minima, a clean and minimal Hugo theme porting from Minima on Hexo. It not only inherits everything from Hexo Minima like dark/light mode but intgrated KaTeX and some taxonomies like categories, series and tags. I created this from scratch using SCSS and Vanilla JS without unnecessary development packs! 😁" description = "This is Minima, a clean and minimal Hugo theme porting from Minima on Hexo. Except for everything from Hexo Minima like dark/light mode, it supports KaTeX and some taxonomies like categories, series and tags. I created this using SCSS, Vanilla JS and most importantly, Hugo. 😁"
[params] [params]
@ -32,6 +32,8 @@ comment = "disqus"
timeformat = "Jan 2, 2006" timeformat = "Jan 2, 2006"
# switch for turning on/off lights. # switch for turning on/off lights.
switch = ["🌚", "🌝"] switch = ["🌚", "🌝"]
# if true, date of posts will be displayed in the homepage
displayDate = true
# OvO is a comment plugin written by the author of Minima. # OvO is a comment plugin written by the author of Minima.

View file

@ -1,4 +1,6 @@
<div class="flex sm:flex-col my-5 sm:mb-6 sm:mt-3"> <div class="flex sm:flex-col my-5 sm:mb-6 sm:mt-3">
{{ if .Params.displayDate }}
<div class="min-w-32 sm:mb-2 sm:text-sm">{{ dateFormat .Site.Params.timeformat .Date }}</div> <div class="min-w-32 sm:mb-2 sm:text-sm">{{ dateFormat .Site.Params.timeformat .Date }}</div>
{{ end }}
<a class="self-start" href="{{ .RelPermalink }}">{{ .Title }}</a> <a class="self-start" href="{{ .RelPermalink }}">{{ .Title }}</a>
</div> </div>