75 lines
3.4 KiB
HTML
75 lines
3.4 KiB
HTML
{{ define "title" }}{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }} • {{ .Params.event }}{{ end }}
|
|
{{ define "main" }}
|
|
<article class="center bg-white br-3 pv1 ph4 nested-copy-line-height lh-copy f4 nested-links mw-100 measure-wide">
|
|
{{ with .Params.slides }}
|
|
<p><a id="slides_link" class="ba black br-3 bw1 dib no-underline ph2 pv1" href="{{ . | absURL }}">Slides</a>
|
|
{{ end }}
|
|
{{ with .Params.video }}
|
|
<a id="video_link" class="ba black br-3 bw1 dib no-underline ph2 pv1" href="{{ . }}">Video</a>
|
|
{{ end }}
|
|
{{ with .Params.site }}
|
|
<a class="ba black br-3 bw1 dib no-underline ph2 pv1" href="{{ . }}">Website</a>
|
|
{{ end }}
|
|
{{ with .Params.location }}
|
|
<a class="ba black br-3 bw1 dib no-underline ph2 pv1" href="https://www.google.com/maps/place/{{ . }}">Venue</a>
|
|
{{ end }}
|
|
{{ .Content }}
|
|
</article>
|
|
<script type="text/javascript">
|
|
// Add event handlers to slide and video links, to open them in an iframe popup.
|
|
$( function() {
|
|
if ( $( "#slides_link" ).length ) {
|
|
$("#slides_link").click(function(eventObject) {
|
|
eventObject.preventDefault();
|
|
var elem = $( this );
|
|
elem.parent().next("iframe").remove();
|
|
var href = elem.attr("href");
|
|
switch(true) {
|
|
case /\.pdf$/.test(href):
|
|
elem.parent().after($("<iframe frameborder=0 class='ba h5 w-100' src='/js/pdfjs/web/viewer.html?file=" + href + "'></iframe>"));
|
|
break;
|
|
default:
|
|
elem.parent().after($("<iframe frameborder=0 class='ba h5 w-100' src='" + elem.attr("href") + "'></iframe>"));
|
|
// default is just to iframe in the slides page.
|
|
}
|
|
var width = elem.parent().next("iframe").width();
|
|
var height = Math.round(width * 9 / 16);
|
|
elem.parent().next("iframe").height(height);
|
|
});
|
|
}
|
|
if ( $( "#video_link" ).length ) {
|
|
$("#video_link").click(function(eventObject) {
|
|
var elem = $( this );
|
|
elem.parent().next("iframe").remove();
|
|
var href = elem.attr("href");
|
|
switch(true) {
|
|
case /youtube.com/.test(href):
|
|
eventObject.preventDefault();
|
|
href = href.replace("watch?v=", "embed/");
|
|
elem.parent().after($("<iframe frameborder=0 class='ba h5 w-100' src='" + href + "' allow='accelerometer; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"));
|
|
break;
|
|
default:
|
|
// default is just to follow the link.
|
|
// TODO: add a vimeo embedder here? If you're reading this source code, please submit a PR
|
|
// for other video sources you want to be supported here.
|
|
}
|
|
var width = elem.parent().next("iframe").width();
|
|
var height = Math.round(width * 9 / 16);
|
|
elem.parent().next("iframe").height(height);
|
|
});
|
|
}
|
|
});
|
|
|
|
</script>
|
|
{{ end }}
|
|
|
|
{{ define "social" }}
|
|
<meta property="og:title" content="{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }}" />
|
|
<meta property="og:type" content="article" />
|
|
<meta property="og:image" content="{{ default (default "img/default-header-img.jpg" .Params.image) .Params.thumbnail | absURL }}" />
|
|
<meta property="og:description" content="{{ .Description | markdownify }}" />
|
|
<meta property="og:url" content="{{ .Permalink }}" />
|
|
<meta property="og:site_name" content="{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }}" />
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
<meta name="twitter:site" content="@{{ .Site.Params.twitter }}" />
|
|
{{ end }}
|