Skip to content

Commit

Permalink
Enable summary for the post in blog
Browse files Browse the repository at this point in the history
- updating the configuration from params.blog to params
- documentation has been added to enable configuration of summary for blogs

Closes jakewies#73
  • Loading branch information
aldrineeinsteen committed Jul 14, 2020
1 parent 86b772e commit 9773133
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ handle: "hugo-theme-codex"

If you would rather override the about page's layout with your own, you can do so by creating a `layouts/index.html`. You can find the `index.html` file that `hugo-theme-codex` uses [here](https://github.com/jakewies/hugo-theme-codex/blob/master/layouts/index.html).

### Configuring Blog

Blog configurations include:

1. Enabling Summary for every post by providing the configuration in `[params]` section of `config.toml`
```toml
[params]
# Enables summary view on blogs
showSummary = true
```

### Configuring Social Icons

Social Icons are optional. To show any of these icons, just provide the value in the `[params]` section of `config.toml`.
Expand Down
5 changes: 2 additions & 3 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ copyright = "© {year}"
# "Twitter", "GitHub", "Email", "Facebook", "GitLab", "Instagram", "LinkedIn", "YouTube"
iconTitles = ["Twitter", "GitHub"]

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

# This disables Hugo's default syntax highlighting in favor
# of prismjs. If you wish to use Hugo's default syntax highlighting
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h2 class="post__title">
<a href="{{.RelPermalink}}">{{ .Title }}</a>
</h2>
{{if .Site.Params.blog.summary }}
{{if .Site.Params.showSummary }}
{{ .Summary }}
{{if .Truncated }}
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
Expand Down

0 comments on commit 9773133

Please sign in to comment.