Skip to content

Commit

Permalink
Update the post subheader
Browse files Browse the repository at this point in the history
* Make the date format more human friendly (Jan 2, 2018 instead of 2018-01-02)
* Add the estimated reading time
* Add the word count
  • Loading branch information
dguo committed Jun 12, 2018
1 parent febe705 commit 8471241
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/blog/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{{ define "main" }}
<h1>{{ .Title }}</h1>
<small>Published on {{.Date.Format "2006-01-02"}}</small>
<div class="subheader">{{.Date.Format "January 2, 2006"}} · {{ .ReadingTime | lang.NumFmt 0 }} minute{{ if not (eq .ReadingTime 1) }}s{{ end }} to read · {{ .WordCount | lang.NumFmt 0 }} words</div>

{{ partial "anchor.html" .Content }}

Expand Down
8 changes: 7 additions & 1 deletion static/css/post.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
h1 {
margin-bottom: 0.2em;
margin-bottom: 0em;
}

.subheader {
color: #999999;
font-size: 0.9em;
margin-bottom: 2em;
}

0 comments on commit 8471241

Please sign in to comment.