This repository has been archived on 2024-06-06. You can view files and clone it, but cannot push or open issues or pull requests.
vitrine/public/template-example.html

132 lines
4.4 KiB
HTML
Raw Permalink Normal View History

2022-01-06 15:17:14 +01:00
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Template presentation</title>
<meta name="author" content="Josh Dzielak">
<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">
<link rel="stylesheet" href="./reveal-js/css/reset.css">
<link rel="stylesheet" href="./reveal-js/css/reveal.css"><link rel="stylesheet" href="./reveal-js/css/theme/night.css" id="theme">
<link rel="stylesheet" href="./highlight-js/default.min.css">
</head>
<body>
<div class="reveal">
<div class="slides">
<section><h2 id="template-example">Template Example</h2>
</section><section>
<p>This presentation shows how to take advantage of reveal-hugo&rsquo;s slide template feature.</p>
</section><section>
<p>Slide templates let you specify groups of slide attributes in one place and reuse them throughout the presentation.</p>
</section>
<section data-noprocess data-shortcode-slide
data-background="#0011DD"
data-transition="zoom"
data-template="blue">
<p>Here&rsquo;s an example of using a template called <code>blue</code>, defined in the front matter of this presentation&rsquo;s <code>_index.md</code> file.</p>
</section><section>
<p>The template can contain any valid slide customization params:</p>
<pre><code class="language-toml">[reveal_hugo.templates.blue]
background = &quot;#0011DD&quot;
transition = &quot;zoom&quot;
</code></pre>
</section><section>
<p>Then add it to any slide using the slide shortcode:</p>
<pre><code>{{&lt; slide template=&quot;blue&quot; &gt;}}
</code></pre>
</section>
<section data-noprocess data-shortcode-slide
data-background="#424242"
data-transition="convex"
data-template="grey">
<p>Templates can be specified in <code>config.toml</code> as well, for reusability across multiple presentations.</p>
<pre><code>[params.reveal_hugo.templates.grey]
background = &quot;#424242&quot;
transition = &quot;convex&quot;
</code></pre>
</section><section>
<h2 id="the-end">THE END</h2>
</section>
</div>
</div>
<script type="text/javascript" src=./reveal-hugo/object-assign.js></script>
<a href="./reveal-js/css/print/" id="print-location" style="display: none;"></a>
<script type="text/javascript">
var printLocationElement = document.getElementById('print-location');
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = printLocationElement.href + (window.location.search.match(/print-pdf/gi) ? 'pdf.css' : 'paper.css');
document.getElementsByTagName('head')[0].appendChild(link);
</script>
<script type="application/json" id="reveal-hugo-site-params">{"history":true,"templates":{"grey":{"background":"#424242","transition":"convex"}}}</script>
<script type="application/json" id="reveal-hugo-page-params">{"margin":0.2,"templates":{"blue":{"background":"#0011DD","transition":"zoom"}},"theme":"night"}</script>
<script src="./reveal-js/js/reveal.js"></script>
<script type="text/javascript">
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;
}
var revealHugoDefaults = { center: true, controls: true, history: true, progress: true, transition: "slide" };
var revealHugoSiteParams = JSON.parse(document.getElementById('reveal-hugo-site-params').innerHTML);
var revealHugoPageParams = JSON.parse(document.getElementById('reveal-hugo-page-params').innerHTML);
var options = Object.assign({},
camelize(revealHugoDefaults),
camelize(revealHugoSiteParams),
camelize(revealHugoPageParams));
Reveal.initialize(options);
</script>
<script type="text/javascript" src="./reveal-js/plugin/markdown/marked.js"></script>
<script type="text/javascript" src="./reveal-js/plugin/markdown/markdown.js"></script>
<script type="text/javascript" src="./reveal-js/plugin/highlight/highlight.js"></script>
<script type="text/javascript" src="./reveal-js/plugin/zoom-js/zoom.js"></script>
<script type="text/javascript" src="./reveal-js/plugin/notes/notes.js"></script>
</body>
</html>