baseof.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <html lang="{{ site.LanguageCode | default "en-us" }}">
  3. <head>
  4. {{ $media_dir := site.Params.media_dir | default "media" }}
  5. {{ .Scratch.Set "media_dir" $media_dir }}
  6. {{ $css := site.Data.assets.css }}
  7. {{ $cdn_url_reveal := "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.8.0" }}
  8. <meta charset="utf-8">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="generator" content="Source Themes Academic {{ site.Data.academic.version }}">
  12. {{ if site.Home.OutputFormats.Get "WebAppManifest" }}
  13. <link rel="manifest" href="{{ "index.webmanifest" | relLangURL }}">
  14. {{ end }}
  15. <link rel="icon" type="image/png" href="{{(partial "functions/get_icon" 32).RelPermalink}}">
  16. <link rel="apple-touch-icon" type="image/png" href="{{(partial "functions/get_icon" 192).RelPermalink}}">
  17. <link rel="canonical" href="{{ .Permalink }}">
  18. <title>{{ .Title }} | {{ site.Title }}</title>
  19. <link rel="stylesheet" href="{{ $cdn_url_reveal }}/css/reveal.min.css">
  20. {{- $theme := $.Param "slides.theme" | default "black" -}}
  21. <link rel="stylesheet" href="{{ $cdn_url_reveal }}/css/theme/{{ $theme }}.min.css">
  22. {{- $highlight_style := $.Param "slides.highlight_style" | default "dracula" -}}
  23. {{ printf "<link rel=\"stylesheet\" href=\"%s\" crossorigin=\"anonymous\">" (printf $css.highlight.url $css.highlight.version $highlight_style) | safeHTML }}
  24. {{ $css := resources.Get "css/reveal.css" }}
  25. {{ $css_custom := resources.Get "css/reveal_custom.css" }}
  26. {{ $style := slice $css $css_custom | resources.Concat "css/reveal_custom.css" | resources.Minify }}
  27. <link rel="stylesheet" href="{{ $style.RelPermalink }}">
  28. <!-- Printing and PDF exports -->
  29. <script>
  30. var link = document.createElement( 'link' );
  31. link.rel = 'stylesheet';
  32. link.type = 'text/css';
  33. link.href = window.location.search.match( /print-pdf/gi ) ? '{{ $cdn_url_reveal }}/css/print/pdf.css' : '{{ $cdn_url_reveal }}/css/print/paper.css';
  34. document.getElementsByTagName( 'head' )[0].appendChild( link );
  35. </script>
  36. </head>
  37. <body>
  38. {{ block "main" . }}{{ end }}
  39. <script src="{{ $cdn_url_reveal }}/js/reveal.min.js"></script>
  40. <script>
  41. window.revealPlugins = { dependencies: [
  42. // Interpret Markdown in <section> elements.
  43. { src: '{{ $cdn_url_reveal }}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  44. { src: '{{ $cdn_url_reveal }}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  45. // Enable code highlighting.
  46. { src: '{{ $cdn_url_reveal }}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
  47. // Enable zooming.
  48. { src: '{{ $cdn_url_reveal }}/plugin/zoom-js/zoom.js', async: true },
  49. // Enable math.
  50. { src: '{{ $cdn_url_reveal }}/plugin/math/math.js', async: true },
  51. // Enable exporting deck to PDF.
  52. { src: '{{ $cdn_url_reveal }}/plugin/print-pdf/print-pdf.js', async: true },
  53. // Enable speaker notes. Notes plugin must be loaded locally as CDN is missing `notes.html`.
  54. { src: '{{ "js/vendor/reveal.js/plugin/notes/notes.js" | relURL }}', async: true }
  55. ]};
  56. let revealDefaults = { center: true, controls: true, history: true, progress: true, transition: 'slide', mouseWheel: true };
  57. let revealOptions = Object.assign({}, revealDefaults, revealPlugins);
  58. Reveal.initialize(revealOptions);
  59. </script>
  60. </body>
  61. </html>