From 9b47e502462db3a47930d33c3ad4e8577df837e7 Mon Sep 17 00:00:00 2001 From: dzello Date: Tue, 9 Oct 2018 02:25:07 +0200 Subject: [PATCH] Add an end option for inserting HTML before end of .reveal --- exampleSite/content/home/configuration.md | 8 +++++- layouts/_default/baseof.reveal.html | 13 +++++++++- layouts/partials/reveal-hugo/end.html | 1 + layouts/partials/reveal-hugo/slides.html | 31 ++++++++++------------- 4 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 layouts/partials/reveal-hugo/end.html diff --git a/exampleSite/content/home/configuration.md b/exampleSite/content/home/configuration.md index c1b8fef..fa88edf 100644 --- a/exampleSite/content/home/configuration.md +++ b/exampleSite/content/home/configuration.md @@ -82,7 +82,7 @@ Use partials to add HTML to the page for one or all presentations at a time. --- -Here is where partials go for different presentations and places on the page. +Here is where to put partials for different presentations and places in the DOM.

| Presentation | Before </head> | Before </body> | @@ -91,6 +91,12 @@ Here is where partials go for different presentations and places on the page. | Root | home/reveal-hugo/head.html | home/reveal-hugo/body.html | | Section | {section}/reveal-hugo/head.html | {section}/reveal-hugo/body.html | +  + + +💡 You can also create an `end.html` to put content before the end of the `.reveal` div tag. + + --- ## Custom CSS Example diff --git a/layouts/_default/baseof.reveal.html b/layouts/_default/baseof.reveal.html index 5091fe3..30f10d0 100644 --- a/layouts/_default/baseof.reveal.html +++ b/layouts/_default/baseof.reveal.html @@ -39,7 +39,18 @@ {{- if fileExists (printf "layouts/partials/%s.html" $sectionHeadPartial) -}}{{ partial $sectionHeadPartial . }}{{- end }} - {{- block "main" . -}}{{- end -}} +
+
+ {{- block "main" . -}}{{- end -}} +
+ + {{- partial "reveal-hugo/end" . -}} + + {{- $sectionHeadPartial := printf "%s/reveal-hugo/end" (.Page.Section | default "home") -}} + {{- if fileExists (printf "layouts/partials/%s.html" $sectionHeadPartial) -}}{{ partial $sectionHeadPartial . }}{{- end }} +