Skip to content

Commit

Permalink
Add support for post descriptions
Browse files Browse the repository at this point in the history
Adds support for post descriptions, i.e. subtitles. These are presented
in an italicized h4 header under the post title if present in the Hugo
post configuration.
  • Loading branch information
Joshua Boniface committed Jan 27, 2023
1 parent 2ae407d commit 0cf9226
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/css/components/_post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
color: $lightest-color;
}

.post-description {
color: $lightest-color;
font-style: italic;
}

.post-meta > div {
display: flex;
align-items: center;
Expand Down
3 changes: 3 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<article class="post">
<header class="post-header">
<h1 class ="post-title">{{ .Title }}</h1>
{{- if ne .Description }}
<h4 class ="post-description">{{ .Description }}</h4>
{{- end }}
{{- if ne .Type "page" }}
<div class="post-meta">
<div>
Expand Down

0 comments on commit 0cf9226

Please sign in to comment.