Skip to content

Commit

Permalink
Enable summary for the post in blog
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrineeinsteen committed Jul 14, 2020
1 parent 3f6c412 commit 722329a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ copyright = "© {year}"
# "Twitter", "GitHub", "Email", "Facebook", "GitLab", "Instagram", "LinkedIn", "YouTube"
iconTitles = ["Twitter", "GitHub"]

[params.blog]
# Enables summary view on blogs
summary = true

# This disables Hugo's default syntax highlighting in favor
# of prismjs. If you wish to use Hugo's default syntax highlighting
# over prismjs, remove this. You will also need to remove the prismjs
Expand Down
7 changes: 7 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
<h2 class="post__title">
<a href="{{.RelPermalink}}">{{ .Title }}</a>
</h2>
{{ .Summary }}
{{if .Truncated }}
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
<div class="post__title" align="right">
<a href="{{ .RelPermalink }}">Read More</a>
</div>
{{ end }}
{{ partial "tags.html" .}}
</div>
</li>
Expand Down

0 comments on commit 722329a

Please sign in to comment.