2018-04-26 18:20:41 -05:00
|
|
|
<!doctype html>
|
2018-08-13 11:21:46 -05:00
|
|
|
{{- $reveal_cdn := $.Param "reveal_hugo.reveal_cdn" | default "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0" -}}
|
2018-08-07 11:02:47 -05:00
|
|
|
{{- $highlight_cdn := $.Param "reveal_hugo.highlight_cdn" | default "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0" -}}
|
2018-04-26 18:20:41 -05:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2018-04-26 18:34:29 -05:00
|
|
|
<title>{{ or .Page.Title .Site.Title }}</title>
|
2018-08-07 11:02:47 -05:00
|
|
|
{{ with $.Param "description" }}<meta name="description" content="{{ . }}">{{ end }}
|
|
|
|
{{ with .Site.Author.name }}<meta name="author" content="{{ . }}">{{ end }}
|
2018-04-26 18:20:41 -05:00
|
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
2018-04-30 17:21:33 -05:00
|
|
|
<link rel="stylesheet" href="{{ $reveal_cdn }}/css/reveal.min.css">
|
|
|
|
<!-- Theme used for presentation -->
|
2018-08-07 11:02:47 -05:00
|
|
|
{{- $theme := $.Param "reveal_hugo.theme" | default "black" -}}
|
|
|
|
{{- $custom_theme := $.Param "reveal_hugo.custom_theme" -}}
|
2018-07-22 03:54:47 -05:00
|
|
|
{{- if $custom_theme -}}
|
2018-05-01 03:46:00 -05:00
|
|
|
<link rel="stylesheet" href="{{ $custom_theme | relURL }}" id="theme">
|
2018-07-22 03:54:47 -05:00
|
|
|
{{ else -}}
|
2018-04-30 17:21:33 -05:00
|
|
|
<link rel="stylesheet" href="{{ $reveal_cdn }}/css/theme/{{ $theme }}.css" id="theme">
|
2018-07-22 03:54:47 -05:00
|
|
|
{{- end -}}
|
2018-04-26 18:20:41 -05:00
|
|
|
<!-- Theme used for syntax highlighting of code -->
|
2018-08-07 11:02:47 -05:00
|
|
|
{{- $highlight_theme := $.Param "reveal_hugo.highlight_theme" | default "default" -}}
|
2018-04-30 17:21:33 -05:00
|
|
|
<link rel="stylesheet" href="{{ $highlight_cdn }}/styles/{{ $highlight_theme }}.min.css">
|
2018-04-26 18:20:41 -05:00
|
|
|
<!-- Printing and PDF exports -->
|
|
|
|
<script>
|
|
|
|
var link = document.createElement( 'link' );
|
|
|
|
link.rel = 'stylesheet';
|
|
|
|
link.type = 'text/css';
|
2018-04-30 17:21:33 -05:00
|
|
|
link.href = window.location.search.match( /print-pdf/gi ) ? '{{ $reveal_cdn}}/css/print/pdf.css' : '{{ $reveal_cdn }}/css/print/paper.css';
|
2018-04-26 18:20:41 -05:00
|
|
|
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
|
|
|
</script>
|
2018-08-13 10:41:06 -05:00
|
|
|
<!-- To insert markup before the closing head tag for all presentations,
|
|
|
|
create layouts/partials/reveal-hugo/head.html -->
|
2018-07-22 03:54:47 -05:00
|
|
|
{{- partial "reveal-hugo/head" . -}}
|
2018-08-13 10:41:06 -05:00
|
|
|
<!-- To insert markup at the end of the head tag for a specific presentation,
|
|
|
|
create layouts/partials/{section}/reveal-hugo/head.html -->
|
|
|
|
{{- $sectionHeadPartial := printf "%s/reveal-hugo/head" (.Page.Section | default "home") -}}
|
|
|
|
{{- if fileExists (printf "layouts/partials/%s.html" $sectionHeadPartial) -}}{{ partial $sectionHeadPartial . }}{{- end }}
|
2018-04-26 18:20:41 -05:00
|
|
|
</head>
|
|
|
|
<body>
|
2018-07-22 03:54:47 -05:00
|
|
|
{{- block "main" . -}}{{- end -}}
|
2018-04-30 15:19:22 -05:00
|
|
|
<script type="application/json" id="reveal-hugo-site-params">{{ jsonify .Site.Params.reveal_hugo | safeJS }}</script>
|
2018-08-07 10:43:24 -05:00
|
|
|
<script type="application/json" id="reveal-hugo-page-params">{{ jsonify .Page.Params.reveal_hugo | safeJS }}</script>
|
2018-08-13 10:41:06 -05:00
|
|
|
<script type="text/javascript"> window.revealHugoDependencies = { dependencies: [ { src: '{{ $reveal_cdn }}/lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
2018-04-30 20:47:20 -05:00
|
|
|
{ src: '{{ $reveal_cdn }}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
|
|
|
{ src: '{{ $reveal_cdn }}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
2018-04-30 17:21:33 -05:00
|
|
|
{ src: '{{ $reveal_cdn }}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
|
|
|
|
{ src: '{{ $reveal_cdn }}/plugin/zoom-js/zoom.js', async: true },
|
|
|
|
// the notes plugin can't run off the CDN b/c the HTML file isn't there
|
|
|
|
{ src: '{{ "reveal-hugo/plugin/notes/notes.js" | relURL }}', async: true }
|
2018-04-30 14:58:55 -05:00
|
|
|
]};
|
2018-04-26 18:20:41 -05:00
|
|
|
</script>
|
2018-04-30 17:21:33 -05:00
|
|
|
<script src="{{ $reveal_cdn }}/lib/js/head.min.js"></script>
|
|
|
|
<script src="{{ $reveal_cdn }}/js/reveal.js"></script>
|
|
|
|
<script type="text/javascript">
|
2018-05-01 02:26:56 -05:00
|
|
|
// Hugo lowercases all params and Reveal.js needs camelcase
|
|
|
|
// So params in Hugo must be stored in snakecase and we camelize them here
|
|
|
|
function camelize(map) {
|
|
|
|
if (map) {
|
|
|
|
Object.keys(map).forEach(function(k) {
|
|
|
|
newK = k.replace(/(\_\w)/g, function(m) { return m[1].toUpperCase() });
|
|
|
|
if (newK != k) {
|
|
|
|
map[newK] = map[k];
|
|
|
|
delete map[k];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return map;
|
|
|
|
}
|
2018-04-30 17:21:33 -05:00
|
|
|
// pattern inspired by https://github.com/RealOrangeOne/hugo-theme-revealjs
|
2018-08-07 10:43:24 -05:00
|
|
|
var revealHugoDefaults = { center: true, controls: true, history: true, progress: true, transition: "slide" };
|
2018-04-30 17:21:33 -05:00
|
|
|
var revealHugoSiteParams = JSON.parse(document.getElementById('reveal-hugo-site-params').innerHTML);
|
2018-08-07 10:43:24 -05:00
|
|
|
var revealHugoPageParams = JSON.parse(document.getElementById('reveal-hugo-page-params').innerHTML);
|
2018-04-30 17:21:33 -05:00
|
|
|
// See all options - https://github.com/hakimel/reveal.js#configuration
|
2018-07-02 17:12:32 -05:00
|
|
|
var options = Object.assign({},
|
2018-05-01 02:26:56 -05:00
|
|
|
camelize(revealHugoDefaults),
|
|
|
|
camelize(revealHugoSiteParams),
|
|
|
|
camelize(revealHugoPageParams),
|
|
|
|
revealHugoDependencies);
|
|
|
|
Reveal.initialize(options);
|
2018-04-30 17:21:33 -05:00
|
|
|
</script>
|
2018-08-13 10:41:06 -05:00
|
|
|
<!-- To insert markup before the closing body tag for all presentations,
|
|
|
|
create layouts/partials/reveal-hugo/body.html -->
|
|
|
|
{{- partial "reveal-hugo/body" . }}
|
|
|
|
<!-- To insert markup at the end of the head tag for a specific presentation,
|
|
|
|
create layouts/partials/{section}/reveal-hugo/body.html -->
|
|
|
|
{{- $sectionBodyPartial := printf "%s/reveal-hugo/body" (.Page.Section | default "home") -}}
|
|
|
|
{{- if fileExists (printf "layouts/partials/%s.html" $sectionBodyPartial) -}}{{ partial $sectionBodyPartial . }}{{- end }}
|
2018-04-26 18:20:41 -05:00
|
|
|
</body>
|
|
|
|
</html>
|