From 80695973ac0e3dd9a846f055d43fe3969b711144 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Tue, 25 Jul 2017 10:18:25 +0200 Subject: Fix disqusShortname conditional Fixes #43 --- layouts/_default/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts/_default/single.html') diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 96c9f94..2a8e053 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -9,7 +9,7 @@ {{ .Content }} - {{ if and (isset .Site.Params "disqusShortname") (ne .Site.Params.disqusShortname "") }} + {{ if .Site.Params.disqusShortname }}

Comments

{{ partial "disqus" . }} {{ end }} -- cgit 1.4.1 From 5aab5b03ab910f0920b961ebda2f7f75f685b121 Mon Sep 17 00:00:00 2001 From: Vivek Ghaisas Date: Fri, 26 May 2017 23:13:31 +0300 Subject: Fix indentation in layouts - Change indentation to 2 spaces to match convention - Don't indent and as per convention --- layouts/_default/list.html | 12 ++++++------ layouts/_default/single.html | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'layouts/_default/single.html') diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 7659d47..c362b25 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,15 +1,15 @@ {{ partial "head.html" . }} -{{ partial "sidebar.html" . }} + {{ partial "sidebar.html" . }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2a8e053..26149e7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,13 +1,13 @@ - {{ partial "head.html" . }} - - {{ partial "sidebar.html" . }} +{{ partial "head.html" . }} + + {{ partial "sidebar.html" . }} -
-
-

{{ .Title }}

- - {{ .Content }} -
+
+
+

{{ .Title }}

+ + {{ .Content }} +
{{ if .Site.Params.disqusShortname }}

Comments

@@ -15,5 +15,5 @@ {{ end }}
- - + + \ No newline at end of file -- cgit 1.4.1 From 82832c1244f2d536c754efb98fbdb02b1844f4c7 Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Thu, 7 Sep 2017 21:41:16 +0200 Subject: Make use of the base template --- layouts/404.html | 16 ++++------------ layouts/_default/baseof.html | 8 ++++++++ layouts/_default/list.html | 25 +++++++++---------------- layouts/_default/single.html | 29 +++++++++++------------------ layouts/index.html | 33 ++++++++++----------------------- 5 files changed, 42 insertions(+), 69 deletions(-) create mode 100644 layouts/_default/baseof.html (limited to 'layouts/_default/single.html') diff --git a/layouts/404.html b/layouts/404.html index 8fa1a59..a919514 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,12 +1,4 @@ -{{ partial "head.html" . }} - - -{{ partial "sidebar.html" . }} - -
-

404: Page not found

-

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.

-
- - - +{{ define "main" -}} +

404: Page not found

+

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.

+{{- end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..a45cf37 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,8 @@ +{{ partial "head.html" . }} + + {{ partial "sidebar.html" . }} +
+ {{ block "main" . -}}{{- end }} +
+ + \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c362b25..c6d3b69 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,16 +1,9 @@ -{{ partial "head.html" . }} - - - {{ partial "sidebar.html" . }} - -
- -
- - +{{ define "main" -}} + +{{- end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 26149e7..2317495 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,19 +1,12 @@ -{{ partial "head.html" . }} - - {{ partial "sidebar.html" . }} +{{ define "main" -}} +
+

{{ .Title }}

+ + {{ .Content }} +
-
-
-

{{ .Title }}

- - {{ .Content }} -
- - {{ if .Site.Params.disqusShortname }} -

Comments

- {{ partial "disqus" . }} - {{ end }} -
- - - \ No newline at end of file +{{ if .Site.Params.disqusShortname -}} +

Comments

+{{ partial "disqus" . }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 36f3ac2..3fed5be 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,26 +1,13 @@ -{{ partial "head.html" . }} - - -{{ partial "sidebar.html" . }} - -
+{{ define "main" -}}
- - {{ range .Data.Pages }} -
-

- - {{ .Title }} - -

- - - - {{ .Content }} -
- {{ end }} +{{ range .Data.Pages -}} +
+

+ {{ .Title }} +

+ + {{ .Content }}
+{{- end }}
- - - +{{- end }} \ No newline at end of file -- cgit 1.4.1 From 8349cf1aa1bf4675ba10bc47882a7fb089a54ceb Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Thu, 7 Sep 2017 21:44:44 +0200 Subject: Remove custom Disqus template --- layouts/_default/single.html | 2 +- layouts/partials/disqus.html | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 layouts/partials/disqus.html (limited to 'layouts/_default/single.html') diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2317495..c5fdbc2 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,6 +7,6 @@ {{ if .Site.Params.disqusShortname -}}

Comments

-{{ partial "disqus" . }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html deleted file mode 100644 index 323ae04..0000000 --- a/layouts/partials/disqus.html +++ /dev/null @@ -1,14 +0,0 @@ -
- - -
\ No newline at end of file -- cgit 1.4.1 From eab1974019b3d82cb76cb806ba059fb6cc196111 Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Thu, 7 Sep 2017 21:52:10 +0200 Subject: Switch to Hugo's built-in Disqus template --- README.md | 11 +++-------- layouts/_default/single.html | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'layouts/_default/single.html') diff --git a/README.md b/README.md index e318520..41f2d5e 100644 --- a/README.md +++ b/README.md @@ -119,19 +119,14 @@ params: ### Disqus -You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to the `params` in your config file. +You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to your config file. **TOML** ```toml -[params] - disqusShortname = "spf13" +disqusShortname = "spf13" ``` -**YAML** -```yaml -params: - disqusShortname: "spf13" -``` +> **Note:** Previous version 1.0 the Disqus shortname had to be defined inside the `[params]` block. ## Author **Mark Otto** diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c5fdbc2..a9f5d33 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -5,8 +5,8 @@ {{ .Content }}
-{{ if .Site.Params.disqusShortname -}} +{{ if .Site.DisqusShortname -}}

Comments

- +{{ template "_internal/disqus.html" . }} {{- end }} {{- end }} \ No newline at end of file -- cgit 1.4.1