diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-27 17:46:59 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-27 17:46:59 +0530 |
commit | 644c56cafceb495f44c3566fe08e397cfdab85f1 (patch) | |
tree | 29318f7e5d33387b0aa3f078f8447e20bdb3d9ae | |
parent | 821d93cdf5f196dbe9c8f324476bcdeb2facfe41 (diff) |
using <time> to show blog date
-rw-r--r-- | layouts/partials/blog-list.html | 10 | ||||
-rw-r--r-- | static/css/blog.css | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/layouts/partials/blog-list.html b/layouts/partials/blog-list.html index c05eb84..d39be55 100644 --- a/layouts/partials/blog-list.html +++ b/layouts/partials/blog-list.html @@ -2,14 +2,8 @@ <div class="blog-post-wrapper"> <a class="blog-post-anchor" href="{{ .RelPermalink }}"> <div class="blog-post"> - <span class="date"> - {{/* .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} {{ .Date.Format "January" */}} - {{ .Date.Format "02" }} {{ .Date.Format "Jan" }} - </span> - - <span class="title"> - {{ .Title }} - </span> + <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "02 Jan" }}</time> + <span class="title">{{ .Title }}</span> </div> </a> </div> diff --git a/static/css/blog.css b/static/css/blog.css index 1206a5e..eb2e9a0 100644 --- a/static/css/blog.css +++ b/static/css/blog.css @@ -54,7 +54,7 @@ padding-left: 0.8rem; } -#blog-list .blog-post .date { +#blog-list .blog-post time { color: var(--blog-date-color); } |