mirror of
https://github.com/Threnklyn/reveal-hugo.git
synced 2026-06-06 21:50:48 +02:00
Add an end option for inserting HTML before end of .reveal
This commit is contained in:
@@ -39,7 +39,18 @@
|
||||
{{- if fileExists (printf "layouts/partials/%s.html" $sectionHeadPartial) -}}{{ partial $sectionHeadPartial . }}{{- end }}
|
||||
</head>
|
||||
<body>
|
||||
{{- block "main" . -}}{{- end -}}
|
||||
<div class="reveal">
|
||||
<div class="slides">
|
||||
{{- block "main" . -}}{{- end -}}
|
||||
</div>
|
||||
<!-- To insert markup at the end of the .reveal tag for all presentations,
|
||||
create layouts/partials/reveal-hugo/end.html -->
|
||||
{{- partial "reveal-hugo/end" . -}}
|
||||
<!-- To insert markup at the end of the .reveal tag for a specific presentation,
|
||||
create layouts/partials/{section}/reveal-hugo/end.html -->
|
||||
{{- $sectionHeadPartial := printf "%s/reveal-hugo/end" (.Page.Section | default "home") -}}
|
||||
{{- if fileExists (printf "layouts/partials/%s.html" $sectionHeadPartial) -}}{{ partial $sectionHeadPartial . }}{{- end }}
|
||||
</div>
|
||||
<script type="application/json" id="reveal-hugo-site-params">{{ jsonify .Site.Params.reveal_hugo | safeJS }}</script>
|
||||
<script type="application/json" id="reveal-hugo-page-params">{{ jsonify .Page.Params.reveal_hugo | safeJS }}</script>
|
||||
<script type="text/javascript"> window.revealHugoDependencies = { dependencies: [ { src: '{{ $reveal_cdn }}/lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<!-- override this partial to add content before the .reveal tag closes -->
|
||||
@@ -1,22 +1,17 @@
|
||||
<div class="reveal">
|
||||
<!-- Any section element inside of this container is displayed as a slide -->
|
||||
<div class="slides">
|
||||
<!-- Use the array of pages passed as a param -->
|
||||
{{ range . -}}
|
||||
<!-- Don't process empty content files -->
|
||||
{{- if ne (len .Content) 0 -}}
|
||||
<!-- Remove the <hr /> tag generated by blackfriday for footnotes -->
|
||||
{{- $content := replace .Content "<div class=\"footnotes\">\n\n<hr />" "<div class=\"footnotes\">" -}}
|
||||
<!-- Split the processed content by <hr /> tag -->
|
||||
{{- range (split $content "<hr />") -}}
|
||||
<!-- Only wrap in <section> tag if not already wrapped by shortcode -->
|
||||
{{- if not (in . "data-noprocess") -}}
|
||||
<!-- Use the array of pages passed as a param -->
|
||||
{{ range . -}}
|
||||
<!-- Don't process empty content files -->
|
||||
{{- if ne (len .Content) 0 -}}
|
||||
<!-- Remove the <hr /> tag generated by blackfriday for footnotes -->
|
||||
{{- $content := replace .Content "<div class=\"footnotes\">\n\n<hr />" "<div class=\"footnotes\">" -}}
|
||||
<!-- Split the processed content by <hr /> tag -->
|
||||
{{- range (split $content "<hr />") -}}
|
||||
<!-- Only wrap in <section> tag if not already wrapped by shortcode -->
|
||||
{{- if not (in . "data-noprocess") -}}
|
||||
<section>
|
||||
{{- end -}}
|
||||
{{- . | safeHTML -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user