Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#73 Enable summary for the post in blog #75

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
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
aldrineeinsteen marked this conversation as resolved.
Show resolved Hide resolved

# 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
9 changes: 9 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
<h2 class="post__title">
<a href="{{.RelPermalink}}">{{ .Title }}</a>
</h2>
{{if .Site.Params.blog.summary }}
aldrineeinsteen marked this conversation as resolved.
Show resolved Hide resolved
{{ .Summary }}
{{if .Truncated }}
jakewies marked this conversation as resolved.
Show resolved Hide resolved
<!-- 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 }}
{{ end }}
{{ partial "tags.html" .}}
</div>
</li>
Expand Down