Switch themes to minimo

This commit is contained in:
Dave Gallant
2021-09-06 11:55:05 -04:00
parent 75f9797c91
commit 4ff7aec7c1
302 changed files with 17841 additions and 607 deletions

View File

@@ -0,0 +1,33 @@
{{- $defaultConfig := .Site.Data.config.default.widgets.about -}}
{{- $configData := ( or .Site.Data.config.widgets.about $defaultConfig ) -}}
{{- $lang := .Site.Language.Lang -}}
{{- $config := ( ( index $configData $lang ) | default $configData ) -}}
<section class='widget widget-about sep-after'>
<header>
{{ with $config.logo }}
<div class='logo'>
<a href='{{ $.Site.Home.RelPermalink }}'>
<img src='{{ . | relURL }}'>
</a>
</div>
{{ end }}
<h2 class='title site-title '>
<a href='{{ $.Site.Home.RelPermalink }}'>
{{ with $config.title }}
{{- . -}}
{{ else }}
{{- .Site.Title -}}
{{ end }}
</a>
</h2>
<div class='desc'>
{{ with $config.description }}
{{- . | markdownify -}}
{{ else }}
{{- .Site.Params.info.description -}}
{{ end }}
</div>
</header>
</section>

View File

@@ -0,0 +1,58 @@
{{- $defaultConfig := .Site.Data.config.default.widgets.breadcrumbs -}}
{{- $configData := ( or .Site.Data.config.widgets.breadcrumbs $defaultConfig ) -}}
{{- $lang := .Site.Language.Lang -}}
{{- $config := ( ( index $configData $lang ) | default $configData ) -}}
{{- define "breadcrumbs_add_parents" -}}
{{- .Scratch.Set "parent" .Page.Parent -}}
{{- if eq .Page.Kind "term" -}}
{{- .Scratch.Set "parent" ( .Page.Site.GetPage ( print "/" .Page.Data.Plural ) ) -}}
{{- end -}}
{{- $parent := ( .Scratch.Get "parent" ) -}}
{{- if $parent -}}
{{- if and ( ne $parent.Kind "home" ) ( not ( in .Config.excludeParents $parent.Type ) ) -}}
{{- .Scratch.Add "crumbs" $parent -}}
{{- end }}
{{ template "breadcrumbs_add_parents" ( dict "Config" .Config "Page" $parent "Scratch" .Scratch ) }}
{{- end -}}
{{- end -}}
{{- define "breadcrumbs" -}}
{{- $crumbs := ( .Scratch.Get "crumbs" ) -}}
{{- $length := len $crumbs -}}
{{- $separator := .Config.separator -}}
<style>.widget-breadcrumbs li:after{content:'{{- $separator | default "/" -}}'}</style>
<section class='widget widget-breadcrumbs sep-after'>
<nav id='breadcrumbs'>
<ol>
{{- range $i, $_ := $crumbs -}}
{{- $crumb := ( index $crumbs ( sub $length ( add $i 1 ) ) ) -}}
<li>
{{- if lt ( add $i 1 ) $length -}}
<a href='{{- $crumb.RelPermalink -}}'>
{{- $crumb.LinkTitle -}}
</a>
{{- else -}}
<span>
{{- $crumb.LinkTitle -}}
</span>
{{- end -}}
</li>
{{- end -}}
</ol>
</nav>
</section>
{{- end -}}
{{- $scratch := newScratch -}}
{{- $scratch.Set "crumbs" ( slice . ) -}}
{{- template "breadcrumbs_add_parents" ( dict "Config" $config "Page" . "Scratch" $scratch ) -}}
{{- if ne .Kind "home" -}}
{{- $scratch.Add "crumbs" .Site.Home -}}
{{- end -}}
{{- template "breadcrumbs" ( dict "Config" $config "Scratch" $scratch ) -}}

View File

@@ -0,0 +1,20 @@
{{- $defaultConfig := .Site.Data.config.default.widgets.recent_posts -}}
{{- $configData := ( or .Site.Data.config.widgets.recent_posts $defaultConfig ) -}}
{{- $lang := .Site.Language.Lang -}}
{{- $config := ( ( index $configData $lang ) | default $configData ) -}}
{{- $length := ( $config.length | default 5 ) -}}
<section class='widget widget-recent_posts sep-after'>
<header>
<h4 class='title widget-title'>
{{- $config.title | default ( i18n "recentPosts" ) -}}
</h4>
</header>
<ul class='list'>
{{ range ( first $length ( where .Site.RegularPages "Type" "not in" $config.excludeTypes ) ) }}
{{ .Render "li" }}
{{ end }}
</ul>
</section>

View File

@@ -0,0 +1,27 @@
{{- $defaultConfig := .Site.Data.config.default.widgets.search -}}
{{- $configData := ( or .Site.Data.config.widgets.search $defaultConfig ) -}}
{{- $lang := .Site.Language.Lang -}}
{{- $config := ( ( index $configData $lang ) | default $configData ) -}}
<section class='widget widget-search sep-after'>
<header>
<h4 class='title widget-title'>
{{- $config.title | default ( i18n "search" ) -}}
</h4>
</header>
<form action='{{ "search" | relLangURL }}' id='search-form' class='search-form'>
<label>
<span class='screen-reader-text'>{{ i18n "search" }}</span>
<input id='search-term' class='search-term' type='search' name='q' placeholder='{{ i18n "search" }}&hellip;'>
</label>
{{- if eq .Layout "search" -}}
<button type='submit' class='search-submit'>
<span class='screen-reader-text'>{{ i18n "search" }}</span>
{{- partial "svg/icon" "search" -}}
</button>
{{- end -}}
</form>
</section>

View File

@@ -0,0 +1,72 @@
{{- $defaultConfig := .Site.Data.config.default.widgets.sidebar_menu -}}
{{- $configData := ( or .Site.Data.config.widgets.sidebar_menu $defaultConfig ) -}}
{{- $lang := .Site.Language.Lang -}}
{{- $config := ( ( index $configData $lang ) | default $configData ) -}}
{{- $menu := ( $config.mirror | default "sidebar" ) -}}
{{- $.Scratch.Set "menu" $menu -}}
{{- $items := ( index .Site.Menus $menu ) -}}
{{- if $items -}}
<section class='widget widget-sidebar_menu sep-after'>
{{- with $config.title -}}
<header>
<h4 class='title widget-title'>
{{- . -}}
</h4>
</header>
{{- end -}}
<nav id='sidebar-menu' class='menu sidebar-menu' aria-label='{{ i18n "sidebarMenu" }}'>
<div class='container'>
<ul>
{{- range $items -}}
{{- template "menu_item" ( dict "Item" . "Page" $ ) -}}
{{- end -}}
</ul>
</div>
</nav>
</section>
{{- end -}}
{{- define "menu_item" -}}
{{- $menu := ( .Page.Scratch.Get "menu" ) -}}
{{- $isCurrent := ( .Page.IsMenuCurrent $menu .Item ) -}}
{{- $hasCurrent := ( .Page.HasMenuCurrent $menu .Item ) -}}
{{- $hasChildren := ( .Item.HasChildren ) -}}
<li class='item
{{- if $hasChildren }} has-children {{- end -}}
{{- if $hasCurrent }} has-current {{- end -}}
{{- if $isCurrent }} current {{- end -}}
'>
<a {{ if $isCurrent -}} aria-current='page' {{ end -}} href='{{ .Item.URL }}'>
{{- with .Item.Pre -}}{{- . -}}{{- end -}}
{{- .Item.Name -}}
{{- with .Item.Post -}}{{- . -}}{{- end -}}
</a>
{{- if $hasChildren -}}
<button class='sub-menu-toggler'>
<span class='screen-reader-text'>expand sub menu</span>
<span class='sign'></span>
</button>
<ul class='sub-menu'>
{{- range .Item.Children -}}
{{- template "menu_item" ( dict "Item" . "Page" $.Page ) -}}
{{- end -}}
</ul>
{{- end -}}
</li>
{{- end -}}

View File

@@ -0,0 +1,41 @@
{{- $social := .Site.Params.social -}}
{{- if $social -}}
{{- $defaultConfig := .Site.Data.config.default.widgets.social_menu -}}
{{- $configData := ( or .Site.Data.config.widgets.social_menu $defaultConfig ) -}}
{{- $lang := .Site.Language.Lang -}}
{{- $config := ( ( index $configData $lang ) | default $configData ) -}}
<section class='widget widget-social_menu sep-after'>
{{- with $config.title -}}
<header>
<h4 class='title widget-title'>
{{- . -}}
</h4>
</header>
{{- end -}}
<nav aria-label='{{ i18n "socialMenu" }}'>
<ul>
{{- range $platform := $config.platforms -}}
{{- with $username := ( index $social $platform ) -}}
<li>
<a href='{{ print ( index $.Site.Data.theme.social.base $platform ) $username }}' target='_blank' rel='noopener me'>
<span class='screen-reader-text'>
{{- if eq $platform "email" -}}
{{- i18n "contactViaEmail" -}}
{{- else -}}
{{- i18n "openAccountInNewTab" ( dict "Platform" ( $platform | title ) ) -}}
{{- end -}}
</span>
{{- partial "svg/icon" $platform -}}
</a>
</li>
{{- end -}}
{{- end -}}
</ul>
</nav>
</section>
{{- end -}}

View File

@@ -0,0 +1,20 @@
{{- $defaultConfig := .Site.Data.config.default.widgets.taxonomy_cloud -}}
{{- $configData := ( or .Site.Data.config.widgets.taxonomy_cloud $defaultConfig ) -}}
{{- $lang := .Site.Language.Lang -}}
{{- $config := ( ( index $configData $lang ) | default $configData ) -}}
{{- $shuffle := ( $config.shuffle | default true ) -}}
{{- $taxonomy := ( $config.taxonomy | default "tags" ) -}}
{{- $taxonomyData := ( .Site.GetPage $taxonomy ).Data -}}
{{- $taxonomySingular := $taxonomyData.Singular -}}
<section class='widget widget-taxonomy_cloud sep-after'>
<header>
<h4 class='title widget-title'>
{{- ( $config.title | default ( i18n $taxonomySingular 2 ) ) -}}
</h4>
</header>
{{ partial "extras/taxonomy_cloud" ( dict "Taxonomy" $taxonomy "Shuffle" $shuffle "Scope" . ) }}
</section>