From d5b5a71078159802ace207d6ec40b9bb46a51f34 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Tue, 17 Mar 2020 19:32:27 -0400 Subject: [PATCH] enable comments via utteranc.es --- assets/sass/pages/_single.scss | 10 ++++++++++ config.toml | 1 + layouts/_default/single.html | 6 ++++++ layouts/partials/head/head.html | 2 +- layouts/partials/head/preload.html | 8 +++++++- layouts/partials/scripts/utterances.html | 8 ++++++++ 6 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/scripts/utterances.html diff --git a/assets/sass/pages/_single.scss b/assets/sass/pages/_single.scss index e9c3648b..673f95a4 100644 --- a/assets/sass/pages/_single.scss +++ b/assets/sass/pages/_single.scss @@ -50,6 +50,16 @@ main#single { } } } + + div#comments { + margin-top: 1.5em; + padding-top: 0.5em; + border-top: 2px solid $color-light; + + div.utterances { + max-width: unset; + } + } } diff --git a/config.toml b/config.toml index e620a22d..45a3cddf 100644 --- a/config.toml +++ b/config.toml @@ -32,6 +32,7 @@ disableAliases = true license = "CC-BY-4.0" licenseFull = "Creative Commons Attribution 4.0 International" licenseURL = "https://creativecommons.org/licenses/by/4.0/" + utterancesRepo = "jakejarvis/jarv.is" [author] name = "Jake Jarvis" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 05f3e0ae..3d9be80d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -17,6 +17,12 @@
{{ .Content }}
+ + {{ if eq hugo.Environment "production" }} +
+ {{ partial "scripts/utterances" . }} +
+ {{ end }} {{ end }} diff --git a/layouts/partials/head/head.html b/layouts/partials/head/head.html index ca628b41..8d2b7cae 100644 --- a/layouts/partials/head/head.html +++ b/layouts/partials/head/head.html @@ -2,7 +2,7 @@ {{ partial "functions/social-images" . -}} {{ partial "head/open-graph" . -}} {{ partialCached "head/mobile" . -}} -{{ partialCached "head/preload" . -}} +{{ partial "head/preload" . -}} {{ partialCached "head/styles" . -}} {{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32 48") -}} diff --git a/layouts/partials/head/preload.html b/layouts/partials/head/preload.html index 2a65a142..ae552646 100644 --- a/layouts/partials/head/preload.html +++ b/layouts/partials/head/preload.html @@ -1,4 +1,10 @@ -{{ if eq hugo.Environment "production" }}{{ end }} +{{ if eq hugo.Environment "production" }} + +{{ if and .IsPage (eq .Type "notes") }} + +{{ end }} +{{ end }} + diff --git a/layouts/partials/scripts/utterances.html b/layouts/partials/scripts/utterances.html new file mode 100644 index 00000000..43214d82 --- /dev/null +++ b/layouts/partials/scripts/utterances.html @@ -0,0 +1,8 @@ +