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/logo-example.html

175 lines
6.2 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>Logo presentation example</title>
2022-01-07 14:15:18 +01:00
<meta name="author" content="Fablab Coh@bit - @habsinn">
2022-01-06 15:17:14 +01: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">
<link rel="stylesheet" href="./reveal-js/css/reset.css">
<link rel="stylesheet" href="./reveal-js/css/reveal.css"><link rel="stylesheet" href="./reveal-hugo/themes/robot-lung.css" id="theme"><link rel="stylesheet" href="./highlight-js/default.min.css">
</head>
2022-01-07 14:15:18 +01:00
2022-01-06 15:17:14 +01:00
<body>
<style>
#logo {
position: absolute;
top: 1%;
left: 1%;
width: 15%;
}
</style>
2022-01-07 14:15:18 +01:00
<img id="logo" src="github-logo.png" alt=""/>
2022-01-06 15:17:14 +01:00
<div class="reveal">
<div class="slides">
<section><h2 id="logo-example">logo-example</h2>
<p>This presentation shows how to add a logo to each slide, like the GitHub one you see above.</p>
<p>You can generalize the concept to add any additional markup to your presentations.</p>
</section><section>
<p><a href="https://github.com/dzello/reveal-hugo/blob/master/exampleSite/content/logo-example">See the code for this presentation</a></p>
</section><section>
<p>For a basic setup, in the front matter, add an image to the presentation&rsquo;s directory.</p>
<p>Then, add a logo section in the front matter:</p>
<pre><code class="language-toml">[logo]
src = &quot;github-logo.png&quot;
</code></pre>
<p>The front matter should end up looking like this:</p>
<pre><code class="language-toml">+++
title = &quot;Logo presentation example&quot;
outputs = [&quot;Reveal&quot;]
[logo]
src = &quot;github-logo.png&quot;
+++
</code></pre>
</section><section>
<p>If the logo placement doesn&rsquo;t quite match your needs, you may customize it with the following paramaters:</p>
<pre><code class="language-toml">[logo]
src = &quot;github-logo.png&quot; # Location of the file displayed.
alt = &quot;&quot; # Alt text.
width = &quot;15%&quot; # Size of the file.
diag = &quot;1%&quot; # How far from the top right should the file be.
top = &quot;1%&quot; # Overrides diag.
right = &quot;1%&quot; # Overrides diag.
</code></pre>
<ul>
<li>
<p>Instead of absolute (<code>250px</code>), relative measurments (<code>12.5%</code>) should be used. They work better with different screen sizes.</p>
</li>
<li>
<p>By default, null (<code>&quot;&quot;</code>) is used as alt text for logos, as otherwise the alt text would unneededly get read by screen readers.</p>
</li>
</ul>
</section><section>
<p>💡 Tip: to make the logo settings present on every presentation, add the settings to your site&rsquo;s configuration file <code>config.toml</code> under <code>[params.logo]</code>:</p>
<pre><code class="language-toml">[params.logo]
src = &quot;/img/logo.png&quot;
</code></pre>
<p>Note that now, the path to the logo file shall be absolute, and should be stored in <code>static/img/logo.png</code> instead.</p>
</section><section>
<p>Depending on the theme you&rsquo;re using, your styles will be different. <br>You may also prefer to put your CSS in an external file or your Reveal.js theme.</p>
<p>For per-presentation override, you may add custom CSS with the ID <code>#logo</code> to:</p>
<pre><code class="language-text">layouts/partials/{section}/reveal-hugo/body.html
</code></pre>
<p>Substitute <code>{section}</code> for <code>home</code> if you are adding a logo to the presentation at <code>content/_index.md</code>. Otherwise, substitute the name of the Hugo section where your presentation lives.</p>
<p>For a site-wide override, use:</p>
<pre><code class="language-text">layouts/partials/{section}/reveal-hugo/body.html
</code></pre>
</section><section>
<h1 id="heading">🤗</h1>
<p>That&rsquo;s it.</p>
<p>Happy Hugo-ing!</p>
</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">{"custom_theme":"reveal-hugo/themes/robot-lung.css","margin":0.2}</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>
<style>
#logo {
position: absolute;
top: 20px;
left: 20px;
width: 250px;
}
</style>
<img id="logo" src="github-logo.png" alt="">
</body>
</html>