Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/parsiya/Hugo-Octopress.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDionysis Grigoropoulos <dgrig@erethon.com>2016-05-26 01:05:32 +0300
committerDionysis Grigoropoulos <dgrig@erethon.com>2016-05-26 09:06:52 +0300
commit584ddb093bd0a987d78ef01243c517e6f7aa8a49 (patch)
tree68b30969b0bb93f3bdd9a08d8f81bfd3b0347d1f
parent3f7f37851c5482b06a89456b80710cf39382b042 (diff)
Add an option to hide ReadingTime in posts
-rw-r--r--README.md4
-rw-r--r--layouts/partials/post_header.html2
-rw-r--r--sample-config.toml3
3 files changed, 7 insertions, 2 deletions
diff --git a/README.md b/README.md
index c96ce9d..267cc11 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@ Hugo-Octopress is a port of the classic [Octopress][octopress-link] theme to [Hu
![screenshot](/images/screenshot2.png)
## <a name="config"></a>Configuration
-This section is about parameters in the [configuration file](https://gohugo.io/overview/configuration/) and how they can be used to customize the output. A working config file `sample-config.toml`is provided and parameters are explained below:
+This section is about parameters in the [configuration file](https://gohugo.io/overview/configuration/) and how they can be used to customize the output. A working config file `sample-config.toml` is provided and parameters are explained below:
``` python
baseurl = "http://example.com/"
@@ -118,6 +118,8 @@ post = "/blog/:year-:month-:day-:title/"
notfound_text = """Please either go back or use the navigation/sidebar menus.
"""
+ # Set to true to hide ReadingTime on posts
+ disableReadingTime = false
```
## <a name="highlight"></a>Code highlight
diff --git a/layouts/partials/post_header.html b/layouts/partials/post_header.html
index 3868f4f..b65d6cb 100644
--- a/layouts/partials/post_header.html
+++ b/layouts/partials/post_header.html
@@ -5,7 +5,7 @@
{{ if .IsHome }} <a href="{{ .Permalink }}">{{ .Title }}</a> {{ else }} {{ .Title }} {{ end }}
</h1>
<p class="meta">{{ .Date.Format "Jan 2, 2006" }}
- - {{ .ReadingTime }} minute read
+ {{ if not .Site.Params.disableReadingTime }} - {{ .ReadingTime }} minute read {{ end }}
{{ if .Site.Params.disqusShortname }} - <a href="{{ .Permalink }}#disqus_thread">Comments</a>{{ end }}
{{ if isset .Params "categories" }}
diff --git a/sample-config.toml b/sample-config.toml
index 6943e6d..8912c80 100644
--- a/sample-config.toml
+++ b/sample-config.toml
@@ -136,6 +136,9 @@ post = "/blog/:year-:month-:day-:title/" # change the post URL to look like the
notfound_text = """Please either go back or use the navigation/sidebar menus.
"""
+ # Set to true to hide ReadingTime on posts
+ disableReadingTime = false
+
# blackfriday is Hugo's markdown engine. Options are at: https://gohugo.io/overview/configuration/ (scroll down to "Configure Blackfriday rendering")
[blackfriday]
hrefTargetBlank = true # open the external links in a new window