Website Summary Files Commits Branches @commit @diff @stats
path: root / website / layouts
diff options
context:
space:
mode:
Commit28e13917829d649c71ed1696519db8f1845466b3 (patch)
Author
 Dimitar Trendafilov <trendafilov.dn@gmail.com>
2020-10-04 08:20:14 +0300
Committer
 Dimitar Trendafilov <trendafilov.dn@gmail.com>
2020-10-04 08:20:14 +0300
Files9079ae947a4271ad835f1c9ad10516e6d43f7f20 /website/layouts
IPL-28e13917829d649c71ed1696519db8f1845466b3.tar
IPL-28e13917829d649c71ed1696519db8f1845466b3.tar.gz
IPL-28e13917829d649c71ed1696519db8f1845466b3.zip
Parentb65dbe28ba20a14de4c194e93284f9f1a4aa8858 (diff)
Parent49eed25b200c0f5f0aba46baa3f7332d0e93b276 (diff)
Merge branch 'feature/themes'
- Switch theme to hugo-clarity - Move old content to 2018
diff --git a/website/layouts/_default/baseof.reveal.html b/website/layouts/_default/baseof.reveal.html
deleted file mode 100644
index 1e3868b..0000000
--- a/website/layouts/_default/baseof.reveal.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!doctype html>
-{{- $reveal_cdn := "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0" -}}
-{{- $highlight_cdn := "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0" -}}
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>{{ or .Page.Title .Site.Title }}</title>
- <meta name="description" content="{{ or .Page.Params.Description .Site.Params.Description }}">
- <meta name="author" content="{{ .Site.Author.name }}">
- <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_cdn }}/css/reveal.min.css">
- <!-- Theme used for presentation -->
- {{- $theme := or .Page.Params.reveal_hugo.theme .Site.Params.reveal_hugo.theme .Site.Data.reveal_hugo.defaults.theme "black" -}}
- {{- $custom_theme := or .Page.Params.reveal_hugo.custom_theme .Site.Params.reveal_hugo.custom_theme -}}
- {{- if $custom_theme -}}
- <link rel="stylesheet" href="{{ $custom_theme | relURL }}" id="theme">
- {{ else -}}
- <link rel="stylesheet" href="{{ $reveal_cdn }}/css/theme/{{ $theme }}.css" id="theme">
- {{- end -}}
- <!-- Theme used for syntax highlighting of code -->
- {{- $highlight_theme := or .Page.Params.reveal_hugo.highlight_theme .Site.Params.reveal_hugo.highlight_theme .Site.Data.reveal_hugo.defaults.highlight_theme "default" -}}
- <link rel="stylesheet" href="{{ $highlight_cdn }}/styles/{{ $highlight_theme }}.min.css">
- <!-- Printing and PDF exports -->
- <script>
- var link = document.createElement( 'link' );
- link.rel = 'stylesheet';
- link.type = 'text/css';
- link.href = window.location.search.match( /print-pdf/gi ) ? '{{ $reveal_cdn}}/css/print/pdf.css' : '{{ $reveal_cdn }}/css/print/paper.css';
- document.getElementsByTagName( 'head' )[0].appendChild( link );
- </script>
- <!--[if lt IE 9]>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
- <![endif]-->
- {{- partial "reveal-hugo/head" . -}}
- </head>
- <body>
- {{- block "main" . -}}{{- end -}}
- <script type="application/json" id="reveal-hugo-page-params">{{ jsonify .Page.Params.reveal_hugo | safeJS }}</script>
- <script type="application/json" id="reveal-hugo-site-params">{{ jsonify .Site.Params.reveal_hugo | safeJS }}</script>
- <script type="application/json" id="reveal-hugo-defaults">{{ jsonify .Site.Data.reveal_hugo.defaults | safeJS }}</script>
- <script type="text/javascript">
- window.revealHugoDependencies = {
- dependencies: [
- { src: '{{ $reveal_cdn }}/lib/js/classList.js', condition: function() { return !document.body.classList; } },
- { src: '{{ $reveal_cdn }}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
- { src: '{{ $reveal_cdn }}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
- { src: '{{ $reveal_cdn }}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
- { src: '{{ $reveal_cdn }}/plugin/zoom-js/zoom.js', async: true },
- // the notes plugin can't run off the CDN b/c the HTML file isn't there
- { src: '{{ "reveal-hugo/plugin/notes/notes.js" | relURL }}', async: true }
- ]};
- </script>
- <script src="{{ $reveal_cdn }}/lib/js/head.min.js"></script>
- <script src="{{ $reveal_cdn }}/js/reveal.js"></script>
- <script type="text/javascript">
- // Hugo lowercases all params and Reveal.js needs camelcase
- // So params in Hugo must be stored in snakecase and we camelize them here
- 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;
- }
- // pattern inspired by https://github.com/RealOrangeOne/hugo-theme-revealjs
- var revealHugoPageParams = JSON.parse(document.getElementById('reveal-hugo-page-params').innerHTML);
- var revealHugoSiteParams = JSON.parse(document.getElementById('reveal-hugo-site-params').innerHTML);
- var revealHugoDefaults = JSON.parse(document.getElementById('reveal-hugo-defaults').innerHTML);
- // See all options - https://github.com/hakimel/reveal.js#configuration
- var options = Object.assign({},
- camelize(revealHugoDefaults),
- camelize(revealHugoSiteParams),
- camelize(revealHugoPageParams),
- revealHugoDependencies);
- Reveal.initialize(options);
- </script>
-
- {{ partial "reveal-hugo/body" . }}
- </body>
-</html>
diff --git a/website/layouts/_default/index.reveal.html b/website/layouts/_default/index.reveal.html
deleted file mode 100644
index 8faa735..0000000
--- a/website/layouts/_default/index.reveal.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ define "main" }}
- {{ partial "reveal-hugo/slides" (union (slice .Page) (where .Data.Pages "Type" "home")) }}
-{{ end }}
diff --git a/website/layouts/_default/list.reveal.html b/website/layouts/_default/list.reveal.html
deleted file mode 100644
index 6c3c470..0000000
--- a/website/layouts/_default/list.reveal.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ define "main" }}
- {{ partial "reveal-hugo/slides" (union (slice .Page) .Pages) }}
-{{ end }}
diff --git a/website/layouts/partials/nav.html b/website/layouts/partials/nav.html
new file mode 100644
index 0000000..8d7cf30
--- /dev/null
+++ b/website/layouts/partials/nav.html
@@ -0,0 +1,43 @@
+{{- $params := .Site.Params }}
+{{- $centerLogo := $params.centerLogo }}
+{{ $logo := $params.logo }}
+<header class = 'nav_header' >
+ <nav class = 'nav'>
+ <a href='{{ absURL "" }}' class = 'nav_brand nav_item{{ if eq $centerLogo true }} nav_hide{{ end }}'>
+ {{- with $logo }}
+ <img src="{{ absURL .url }}" width="{{ .width }}" height="{{ .height }}" class="logo">
+ {{- else }}
+ {{ .Site.Title }}
+ {{- end }}
+ <div class = 'nav_close'>
+ <svg class="icon">
+ <use xlink:href="#open-menu"></use>
+ </svg>
+ <svg class="icon">
+ <use xlink:href="#closeme"></use>
+ </svg>
+ </div>
+ </a>
+ <div class = 'nav_body nav_body_{{ .Site.Params.mobileNavigation }}'>
+ {{- $link := .RelPermalink }}
+ {{- range .Site.Data.menu }}
+ <div class = 'nav_parent{{ if eq .link $link }} nav_active{{ end}}'>
+ <a href = '{{ absURL .link }}' class = 'nav_item'>{{ .name }} {{ with .submenu }}<img src= {{ absURL "icons/caret-icon.svg" }} alt="icon" class="nav_icon">{{ end }}</a>
+ {{- with .submenu }}
+ <div class = 'nav_sub'>
+ {{- range . }}
+ <a href = '{{ absURL .link }}' class = 'nav_child nav_item'>{{ .name }}</a>
+ {{- end }}
+ </div>
+ {{- end }}
+ </div>
+ {{- end }}
+ {{- if eq $centerLogo true }}
+ <a href='{{ absURL "" }}' class = 'nav_brand nav_center nav_item'>
+ <img src="{{ absURL $logo }}" class="logo">
+ </a>
+ {{- end }}
+ {{- partial "follow" . }}
+ </div>
+ </nav>
+</header>
diff --git a/website/layouts/partials/reveal-hugo/body.html b/website/layouts/partials/reveal-hugo/body.html
deleted file mode 100644
index f2dd4bf..0000000
--- a/website/layouts/partials/reveal-hugo/body.html
+++ /dev/null
@@ -1 +0,0 @@
-<!-- override this partial to add content before the body tag closes --> \ No newline at end of file
diff --git a/website/layouts/partials/reveal-hugo/head.html b/website/layouts/partials/reveal-hugo/head.html
deleted file mode 100644
index ed1e892..0000000
--- a/website/layouts/partials/reveal-hugo/head.html
+++ /dev/null
@@ -1 +0,0 @@
-<!-- override this partial to add content before the head tag closes --> \ No newline at end of file
diff --git a/website/layouts/partials/reveal-hugo/slides.html b/website/layouts/partials/reveal-hugo/slides.html
deleted file mode 100644
index e578882..0000000
--- a/website/layouts/partials/reveal-hugo/slides.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="reveal">
- <!-- Any section element inside of this container is displayed as a slide -->
- <div class="slides">
- <!-- Use the array of pages passed as a param -->
- {{ range . -}}
- <!-- Don't process empty content files -->
- {{- if ne (len .Content) 0 -}}
- <!-- Remove the <hr /> tag generated by blackfriday for footnotes -->
- {{- $content := replace .Content "<div class=\"footnotes\">\n\n<hr />" "<div class=\"footnotes\">" -}}
- <!-- Split the processed content by <hr /> tag -->
- {{- range (split $content "<hr />") -}}
- <!-- Only wrap in <section> tag if not already wrapped by shortcode -->
- {{- if in . "data-noprocess" -}}
-{{- . | safeHTML -}}
- {{- else }}
-<section>
- {{- . | safeHTML }}
-</section>
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- end }}
- </div>
-</div> \ No newline at end of file
diff --git a/website/layouts/_default/single.reveal.html b/website/layouts/partials/share.html
index e69de29..e69de29 100644
--- a/website/layouts/_default/single.reveal.html
+++ b/website/layouts/partials/share.html
diff --git a/website/layouts/partials/sidebar.html b/website/layouts/partials/sidebar.html
new file mode 100644
index 0000000..738a20c
--- /dev/null
+++ b/website/layouts/partials/sidebar.html
@@ -0,0 +1,66 @@
+{{ $title := .Title }}
+<aside class="sidebar">
+ <section class="sidebar_inner">
+ <h2>{{ .Site.Params.name }}</h2>
+ <div>
+ {{ .Site.Params.description }}
+ </div>
+ <h2 class="mt-4">Featured Posts</h2>
+ <ul>
+ {{ range where .Site.RegularPages "Params.featured" true }}
+ {{- if ne $title .Title }}
+ <li>
+ <a href="{{ .Permalink }}" class="nav-link">{{ .Title }}</a>
+ </li>
+ {{- end }}
+ {{ end }}
+ </ul>
+ <h2 class="mt-4">Recent Posts</h2>
+ <ul class="flex-column">
+ {{ range first 8 (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" true) }}
+ {{- if ne $title .Title }}
+ <li>
+ <a href="{{ .Permalink }}" class="nav-link">{{ .Title }}</a>
+ </li>
+ {{- end }}
+ {{- end }}
+ </ul>
+ {{- $numberOfTagsLimit := $.Site.Params.numberOfTagsShown }} <!-- See config -->
+ {{ range $key, $value := .Site.Taxonomies }}
+ <div>
+ <h2 class="mt-4 taxonomy" id="{{ $key }}-section">{{ $key }}</h2>
+ <nav class="tags_nav">
+ {{- $onPageTags := $.Page.Params.tags }}
+ {{- $slicedTags := ($value.ByCount | first $numberOfTagsLimit) }}
+ {{- range $slicedTags }}
+ <a href='{{ absURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class=" post_tag button button_translucent">
+ {{ upper .Name }}
+ <span class='button_tally'>{{ .Count }}</span>
+ </a>
+ {{ end }}
+ {{ if gt (len $value.ByCount) $numberOfTagsLimit }}
+ <br>
+ <div class="post_tags_toggle button">All {{ $key }}</div>
+ {{- $tagsInfo := newScratch }}
+ <div class="post_tags">
+ <div class="tags_list">
+ {{- range $value.Alphabetical }}
+ {{ $tagsInfo.Add "tagsInfo" (slice .Name .Count)}}
+ <a href='{{ absURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class=" post_tag button button_translucent" data-position={{ .Count }}>
+ {{- upper .Name -}}
+ <span class='button_tally'>{{ .Count }}</span>
+ </a>
+ {{ end }}
+ <div class="tags_sort"><span title="sort alphabetically">[A~Z]</span><span title="sort by count">[0~9]</span>
+ </div>
+ <span class="tags_hide"><svg class="icon">
+ <use xlink:href="#closeme"></use>
+ </svg></span>
+ </div>
+ </div>
+ {{ end }}
+ </nav>
+ </div>
+ {{ end }}
+ </section>
+</aside>
diff --git a/website/layouts/shortcodes/frag.html b/website/layouts/shortcodes/frag.html
deleted file mode 100644
index c1de8c8..0000000
--- a/website/layouts/shortcodes/frag.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<span class='fragment {{ .Get "class" }}'
- {{ with .Get "index" }}data-fragment-index='{{ . }}'{{ end }}>
- {{ .Get "c" }}
-</span> \ No newline at end of file
diff --git a/website/layouts/shortcodes/fragment.html b/website/layouts/shortcodes/fragment.html
deleted file mode 100644
index dc41e03..0000000
--- a/website/layouts/shortcodes/fragment.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<span class='fragment {{ .Get "class" }}'
- {{ with .Get "index" }}data-fragment-index='{{ . }}'{{ end }}>
- {{ .Inner }}
-</span> \ No newline at end of file
diff --git a/website/layouts/shortcodes/markdown.html b/website/layouts/shortcodes/markdown.html
deleted file mode 100644
index f5effbc..0000000
--- a/website/layouts/shortcodes/markdown.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<section data-noprocess data-markdown
- data-separator="^\r?\n---\r?\n$"
- data-separator-vertical="^\r?\n------\r?\n$"
- data-separator-notes="notes?:">
- <script type="text/template">
- {{ .Inner }}
- </script>
-</section> \ No newline at end of file
diff --git a/website/layouts/shortcodes/note.html b/website/layouts/shortcodes/note.html
deleted file mode 100644
index 5d28fce..0000000
--- a/website/layouts/shortcodes/note.html
+++ /dev/null
@@ -1 +0,0 @@
-<aside class="notes">{{ .Inner }}</aside> \ No newline at end of file
diff --git a/website/layouts/shortcodes/readpost.html b/website/layouts/shortcodes/readpost.html
new file mode 100644
index 0000000..5f80a27
--- /dev/null
+++ b/website/layouts/shortcodes/readpost.html
@@ -0,0 +1,10 @@
+{{$file := .Get "file"}}
+{{$content := $file | readFile | replaceRE "^---[[:graph:][:space:]]*?---\n" "" }}
+
+{{- if eq (.Get "markdown") "true" -}}
+ {{- $content | markdownify -}}
+{{- else if (.Get "highlight") -}}
+ {{- highlight ($content) (.Get "highlight") "" -}}
+{{- else -}}
+ {{ $content | safeHTML }}
+{{- end -}}
diff --git a/website/layouts/shortcodes/section.html b/website/layouts/shortcodes/section.html
deleted file mode 100644
index 43611a4..0000000
--- a/website/layouts/shortcodes/section.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<section data-shortcode-section>
-{{ .Inner }}
-</section> \ No newline at end of file
diff --git a/website/layouts/shortcodes/slide.html b/website/layouts/shortcodes/slide.html
deleted file mode 100644
index 7bb41ec..0000000
--- a/website/layouts/shortcodes/slide.html
+++ /dev/null
@@ -1,48 +0,0 @@
-{{- $scratch := .Scratch -}}
-{{- $scratch.Set "slides" slice -}}
-{{- if len .Inner -}}
- {{- $scratch.Add "slides" .Inner -}}
-{{- end -}}
-{{- $content := .Get "content" -}}
-{{- if $content -}}
- {{- $lookup := split $content "." }}
- {{- $html := index .Page.Site.Data (index $lookup 0) (index $lookup 1) | markdownify -}}
- {{- $slides := split $html "<hr />" -}}
- {{- range $slides -}}
- {{- $scratch.Add "slides" . -}}
- {{- end -}}
-{{- end -}}
-{{- $params := . -}}
-{{- $noPrefix := slice "id" "class" -}}
-{{- $noOutput := slice "content" "template" -}}
-{{- range $scratch.Get "slides" }}
-<section data-noprocess data-shortcode-slide
- {{- $template := $params.Get "template" -}}
- {{- if $template -}}
- {{- $scratch.Add "templateParams" (slice $.Site.Params.reveal_hugo.templates) -}}
- {{- if ne $.Page.File.LogicalName "_index.md" -}}
- {{- $scratch.Add "templateParams" (slice ($.Site.GetPage $.Page.Section).Params.reveal_hugo.templates) -}}
- {{- end -}}
- {{- $scratch.Add "templateParams" (slice $.Page.Params.reveal_hugo.templates) -}}
- {{- range ($scratch.Get "templateParams") -}}
- {{- if (ne . nil) -}}
- {{- range $key, $value := (index . $template) -}}
- {{- $scratch.SetInMap "template" $key $value | safeHTMLAttr -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- range $key, $value := ($scratch.Get "template") }}
- {{- $attrName := cond (in $noPrefix $key) $key (delimit (slice "data" $key) "-") }}
- {{ $attrName | safeHTMLAttr }}="{{ $value }}"
- {{- end }}
- data-template="{{ $template }}"
- {{- end -}}
- {{- range $key, $value := $.Params -}}
- {{- if not (in $noOutput $key) -}}
- {{- $attrName := cond (in $noPrefix $key) $key (delimit (slice "data" $key) "-") }}
- {{ $attrName | safeHTMLAttr }}="{{ $value }}"
- {{- end -}}
- {{- end -}}>
- {{ . | safeHTML }}
-</section>
-{{- end -}} \ No newline at end of file