Skip to content

Commit

Permalink
Fix disableReadOtherPosts feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Djordje Atlialp committed Nov 14, 2019
1 parent d56680f commit 276bb50
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -78,6 +78,9 @@ theme = "hello-friend-ng"
dateformNum = "2006-01-02"
dateformNumTime = "2006-01-02 15:04 -0700"

# Set disableReadOtherPosts to true in order to hide the links to other posts.
disableReadOtherPosts = false

# Metadata mostly used in document's head
description = "Homepage and blog by Djordje Atlialp"
keywords = "homepage, blog, science, informatics, development, programming"
Expand Down
10 changes: 6 additions & 4 deletions exampleSite/config.toml
Expand Up @@ -34,9 +34,6 @@ disableSitemap = false
disable404 = false
disableHugoGeneratorInject = false

# Set disableReadOtherPosts to true in order to hide the links to other posts.
disableReadOtherPosts = false

[permalinks]
posts = "/posts/:year/:month/:title/"

Expand All @@ -48,7 +45,7 @@ disableReadOtherPosts = false

[taxonomies]
tag = "tags"
category = ""
category = "categories"

[params]
dateform = "Jan 2, 2006"
Expand All @@ -66,6 +63,9 @@ disableReadOtherPosts = false
# Prefix of link to the git commit detail page. GitInfo must be enabled.
# gitUrl = ""

# Set disableReadOtherPosts to true in order to hide the links to other posts.
disableReadOtherPosts = false

# Integrate Javascript files or stylesheets by adding the url to the external assets or by
# linking local files with their path relative to the static folder, e.g. "css/styles.css"
customCSS = []
Expand All @@ -76,9 +76,11 @@ disableReadOtherPosts = false

# Directory name of your blog content (default is `content/posts`)
contentTypeName = "posts"

# Default theme "light" or "dark"
defaultTheme = "dark"
themeColor = "#252627"

# Colors for favicons
[params.favicon.color]
mask = "#252627"
Expand Down
6 changes: 4 additions & 2 deletions layouts/posts/single.html
Expand Up @@ -15,7 +15,9 @@
</div>

<article>
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>

{{- if .Params.toc }}
<hr />
Expand Down Expand Up @@ -56,7 +58,7 @@ <h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{- end }}
</div>

{{ if and (not .Site.DisableReadOtherPosts) (or .NextInSection .PrevInSection) }}
{{ if and (not $.Site.Params.DisableReadOtherPosts) (or .NextInSection .PrevInSection) }}
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">{{ .Site.Params.ReadOtherPosts }}</span>
Expand Down

0 comments on commit 276bb50

Please sign in to comment.