baseof.html 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. <link rel="manifest" href="{{ "index.webmanifest" | relLangURL }}">
  13. <link rel="icon" type="image/png" href="{{(partial "functions/get_icon" 32).RelPermalink}}">
  14. <link rel="apple-touch-icon" type="image/png" href="{{(partial "functions/get_icon" 192).RelPermalink}}">
  15. <link rel="canonical" href="{{ .Permalink }}">
  16. <title>{{ .Title }} | {{ site.Title }}</title>
  17. <link rel="stylesheet" href="{{ $cdn_url_reveal }}/css/reveal.min.css">
  18. {{- $theme := $.Param "slides.theme" | default "black" -}}
  19. <link rel="stylesheet" href="{{ $cdn_url_reveal }}/css/theme/{{ $theme }}.min.css">
  20. {{- $highlight_style := $.Param "slides.highlight_style" | default "dracula" -}}
  21. {{ printf "<link rel=\"stylesheet\" href=\"%s\" crossorigin=\"anonymous\">" (printf $css.highlight.url $css.highlight.version $highlight_style) | safeHTML }}
  22. {{ $css := resources.Get "css/reveal.css" }}
  23. {{ $css_custom := resources.Get "css/reveal_custom.css" }}
  24. {{ $style := slice $css $css_custom | resources.Concat "css/reveal_custom.css" | resources.Minify }}
  25. <link rel="stylesheet" href="{{ $style.RelPermalink }}">
  26. <!-- Printing and PDF exports -->
  27. <script>
  28. var link = document.createElement( 'link' );
  29. link.rel = 'stylesheet';
  30. link.type = 'text/css';
  31. link.href = window.location.search.match( /print-pdf/gi ) ? '{{ $cdn_url_reveal }}/css/print/pdf.css' : '{{ $cdn_url_reveal }}/css/print/paper.css';
  32. document.getElementsByTagName( 'head' )[0].appendChild( link );
  33. </script>
  34. </head>
  35. <body>
  36. {{ block "main" . }}{{ end }}
  37. <script src="{{ $cdn_url_reveal }}/js/reveal.min.js"></script>
  38. <script>
  39. window.revealPlugins = { dependencies: [
  40. // Interpret Markdown in <section> elements.
  41. { src: '{{ $cdn_url_reveal }}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  42. { src: '{{ $cdn_url_reveal }}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  43. // Enable code highlighting.
  44. { src: '{{ $cdn_url_reveal }}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
  45. // Enable zooming.
  46. { src: '{{ $cdn_url_reveal }}/plugin/zoom-js/zoom.js', async: true },
  47. // Enable math.
  48. { src: '{{ $cdn_url_reveal }}/plugin/math/math.js', async: true },
  49. // Enable exporting deck to PDF.
  50. { src: '{{ $cdn_url_reveal }}/plugin/print-pdf/print-pdf.js', async: true },
  51. // Enable speaker notes. Notes plugin must be loaded locally as CDN is missing `notes.html`.
  52. { src: '{{ "js/vendor/reveal.js/plugin/notes/notes.js" | relURL }}', async: true }
  53. ]};
  54. let revealDefaults = { center: true, controls: true, history: true, progress: true, transition: 'slide', mouseWheel: true };
  55. let revealOptions = Object.assign({}, revealDefaults, revealPlugins);
  56. Reveal.initialize(revealOptions);
  57. </script>
  58. </body>
  59. </html>