Skip to content

Commit

Permalink
feat: add draft label for draft posts
Browse files Browse the repository at this point in the history
  • Loading branch information
cgiacomi committed Oct 11, 2019
1 parent 6e5bf0c commit a6070f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="post-header">
<h1 class="title">{{ .Title }}</h1>
<div class="meta">Posted at &mdash; {{ dateFormat "Jan 2, 2006" .Date }}</div>
<div class="meta">Posted at &mdash; {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
</div>

<div class="markdown">
Expand Down
9 changes: 9 additions & 0 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@ ul {
margin-top: 10px;
}

.post .draft-label {
color: #a00;
text-decoration: none;
padding: 2px 4px;
border-radius: 4px;
margin-left: 6px;
background-color: #f9f2f4;
}

.list .posts .post .meta {
margin-bottom: 0;
margin-left: 5px;
Expand Down

0 comments on commit a6070f5

Please sign in to comment.