diff options
Diffstat (limited to 'themes/new_theme/layouts/partials')
44 files changed, 553 insertions, 100 deletions
diff --git a/themes/new_theme/layouts/partials/authorbox.html b/themes/new_theme/layouts/partials/authorbox.html index cfd09c5..29faa5f 100644 --- a/themes/new_theme/layouts/partials/authorbox.html +++ b/themes/new_theme/layouts/partials/authorbox.html @@ -1,13 +1,24 @@ -{{- if .Site.Params.authorbox }} +{{- if .Param "authorbox" }} <div class="authorbox clearfix"> + {{- if and (not .Site.Author.avatar) (not .Site.Author.name) (not .Site.Author.bio) }} + <p class="authorbox__warning"> + <strong>WARNING:</strong> Authorbox is activated, but [Author] parameters are not specified. + </p> + {{- end }} + {{- with .Site.Author.avatar }} <figure class="authorbox__avatar"> - <img alt="{{ .Site.Author.name }} avatar" src="{{ .Site.Author.avatar | absURL }}" class="avatar" height="90" width="90"> + <img alt="{{ $.Site.Author.name }} avatar" src="{{ $.Site.Author.avatar | relURL }}" class="avatar" height="90" width="90"> </figure> + {{- end }} + {{- with .Site.Author.name }} <div class="authorbox__header"> - <span class="authorbox__name">About {{ .Site.Author.name }}</span> + <span class="authorbox__name">{{ T "authorbox_name" . }}</span> </div> + {{- end }} + {{- with .Site.Author.bio }} <div class="authorbox__description"> - {{ .Site.Author.bio }} + {{ . | markdownify }} </div> + {{- end }} </div> -{{- end }}
\ No newline at end of file +{{- end }} diff --git a/themes/new_theme/layouts/partials/comments.html b/themes/new_theme/layouts/partials/comments.html index e69de29..b2e619d 100644 --- a/themes/new_theme/layouts/partials/comments.html +++ b/themes/new_theme/layouts/partials/comments.html @@ -0,0 +1,5 @@ +{{ if and .Site.DisqusShortname (index .Params "comments" | default "true") (not .Site.IsServer) }} +<section class="comments"> + {{ template "_internal/disqus.html" . }} +</section> +{{ end }} diff --git a/themes/new_theme/layouts/partials/footer.html b/themes/new_theme/layouts/partials/footer.html index d7fce85..092f258 100644 --- a/themes/new_theme/layouts/partials/footer.html +++ b/themes/new_theme/layouts/partials/footer.html @@ -1,15 +1,10 @@ +<footer class="footer"> + <div class="container footer__container flex"> + {{ partial "footer_links.html" . }} + <div class="footer__copyright"> + © {{ .Site.Params.copyright_years }}, {{ .Site.Params.Location }}, {{ .Site.Params.author }}, + <span class="footer__copyright-credits">{{ T "footer_credits" | safeHTML }}</span> + , read here about <a href="/dataprotection">Data Protection and Privacy</a> + </div> </div> - <footer class="footer" itemscope="itemscope" itemtype="http://schema.org/WPFooter"> - <div class="container container-inner"> - <p class="footer__copyright">© {{ .Site.Params.copyright_years }}, {{ .Site.Params.Location }}, {{ .Site.Params.author }}. Based on <a href="//wordpress.org/themes/mh-magazine-lite/" target="_blank" rel="nofollow noopener noreferrer">MH Magazine lite</a>, read here about <a href="/dataprotection">Data Protection and Privacy</a></p> - </div> - </footer> - </div><!-- .mh-container-outer --> - -<script> - var navigation = responsiveNav(".menu", { - navClass: "menu--collapse", - }); -</script> -</body> -</html> +</footer> diff --git a/themes/new_theme/layouts/partials/footer_links.html b/themes/new_theme/layouts/partials/footer_links.html new file mode 100644 index 0000000..04523e8 --- /dev/null +++ b/themes/new_theme/layouts/partials/footer_links.html @@ -0,0 +1,8 @@ +{{- with .Site.Menus.footer }} +<div class="footer__links"> + {{ range $key, $value := . }} + {{- if ne $key 0 }} | {{ end -}} + <a class="footer__link" href="{{ $value.Permalink }}">{{ $value.Name }}</a> + {{- end }} +</div> +{{- end }} diff --git a/themes/new_theme/layouts/partials/header.html b/themes/new_theme/layouts/partials/header.html index 8dff6e7..4548177 100644 --- a/themes/new_theme/layouts/partials/header.html +++ b/themes/new_theme/layouts/partials/header.html @@ -1,30 +1,6 @@ -<!DOCTYPE html> -<html lang="{{ .Site.LanguageCode | default "en-us" }}"> -<head> -<meta charset="UTF-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title>{{ .Title }}</title> -{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }} -{{ .Hugo.Generator }} -{{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }} -<link rel="dns-prefetch" href="//fonts.googleapis.com" /> -{{ if .RSSLink }}<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }} Feed" href="{{ .RSSLink }}">{{ end }} -<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700" type="text/css" media="all" /> -<link rel="stylesheet" href="{{ .Site.BaseURL }}css/magstyle.css" type="text/css" media="all" /> -<link rel="stylesheet" href="{{ .Site.BaseURL }}css/localstyle.css" type="text/css" media="all" /> -<script type="text/javascript" src="{{ .Site.BaseURL }}js/scripts.js"></script> -</head> -<body class="body {{ if (.Site.Params.leftsidebar) or (.Params.leftsidebar) }}body-left-sidebar{{ else }}body-right-sidebar{{ end }} mobile" itemscope="itemscope" itemtype="http://schema.org/WebPage"> - <div class="container container-outer"> - <header class="header" itemscope="itemscope" itemtype="http://schema.org/WPHeader"> - <div class="container container-inner clearfix"> - <div class="logo" role="banner" itemscope="itemscope" itemtype="http://schema.org/Brand"> - <a class="logo__link" href="{{ .Site.BaseURL }}" title="{{ .Site.Title }}" rel="home"> - <h1 class="logo__title">{{ .Site.Params.toptitle }}</h1> - {{ with .Site.Params.subtitle }}<h2 class="logo__tagline">{{ . }}</h2>{{ end }} - </a> - </div> - </div> - {{ partial "menu.html" . }} - </header> - <div class="wrapper clearfix"> +<header class="header"> + <div class="container header__container"> + {{ partial "logo.html" . }} + {{ partial "menu.html" . }} + </div> +</header> diff --git a/themes/new_theme/layouts/partials/header_slide.html b/themes/new_theme/layouts/partials/header_slide.html index 237da66..68e3b60 100644 --- a/themes/new_theme/layouts/partials/header_slide.html +++ b/themes/new_theme/layouts/partials/header_slide.html @@ -33,7 +33,7 @@ <script src="/slide/lib/js/html5shiv.js"></script> {{ "<![endif]-->" | safeHTML }} - {{ .Hugo.Generator }} + {{ hugo.Generator }} </head> <body> diff --git a/themes/new_theme/layouts/partials/logo.html b/themes/new_theme/layouts/partials/logo.html new file mode 100644 index 0000000..bf7d668 --- /dev/null +++ b/themes/new_theme/layouts/partials/logo.html @@ -0,0 +1,24 @@ +{{- $logoTitle := .Site.Params.logo.title | default .Site.Title -}} +{{- $logoSubtitle := .Site.Params.logo.subtitle | default .Site.Params.subtitle -}} +{{- $logoImage := .Site.Params.logo.image -}} + +{{- if or $logoTitle $logoImage }} + {{/* Defined when logo is mixed (image + text) */}} + {{- $logoMix := and $logoImage $logoTitle -}} + + <div class="logo{{ with $logoMix }} logo--mixed{{ end }}"> + <a class="logo__link" href="{{ "" | relLangURL }}"{{ with $logoTitle }} title="{{ . }}"{{ end }} rel="home"> + {{ with $logoImage -}} + <div class="logo__item logo__imagebox"> + <img class="logo__img" src="{{ . | relURL }}"> + </div> + {{- end -}} + {{ with $logoTitle -}} + <div class="logo__item logo__text"> + <div class="logo__title">{{ . }}</div> + {{ with $logoSubtitle }}<div class="logo__tagline">{{ . }}</div>{{ end }} + </div> + {{- end }} + </a> + </div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/mathjax.html b/themes/new_theme/layouts/partials/mathjax.html new file mode 100644 index 0000000..8a5ea04 --- /dev/null +++ b/themes/new_theme/layouts/partials/mathjax.html @@ -0,0 +1,3 @@ +{{ if and .IsPage (eq (.Param "mathjax") true) }} +<script src="{{ .Param "mathjaxPath" | default "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js" }}{{ with .Param "mathjaxConfig" | default "TeX-AMS-MML_HTMLorMML" }}?config={{ . }}{{ end }}" async></script> +{{ end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/menu.html b/themes/new_theme/layouts/partials/menu.html index df9c403..34843c4 100644 --- a/themes/new_theme/layouts/partials/menu.html +++ b/themes/new_theme/layouts/partials/menu.html @@ -1,12 +1,23 @@ -<nav class="menu" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> +{{- if .Site.Menus.main }} +<nav class="menu"> + <button class="menu__btn" aria-haspopup="true" aria-expanded="false" tabindex="0"> + <span class="menu__btn-title" tabindex="-1">{{ T "menu_label" }}</span> + </button> <ul class="menu__list"> - {{- if .Site.Menus.main }} {{- $currentNode := . }} - {{- range sort .Site.Menus.main }} - {{- if ( not ( eq .Name "Data Protection And Privacy" ) ) }} - <li class="menu__item {{if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }}menu__item--active{{end}}"><a class="menu__link" href="{{ .URL }}">{{ .Name | upper }}</a></li> - {{- end }} + {{- range .Site.Menus.main }} + {{- if .Name }} + <li class="menu__item{{ if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }} menu__item--active{{ end }}"> + <a class="menu__link" href="{{ .URL }}"> + {{ .Pre }} + <span class="menu__text">{{ .Name }}</span> + {{ .Post }} + </a> + </li> {{- end }} {{- end }} </ul> </nav> +{{ else -}} +<div class="divider"></div> +{{- end }} diff --git a/themes/new_theme/layouts/partials/pager.html b/themes/new_theme/layouts/partials/pager.html new file mode 100644 index 0000000..78cf9d2 --- /dev/null +++ b/themes/new_theme/layouts/partials/pager.html @@ -0,0 +1,22 @@ +{{- if .Param "pager" }} +{{- if or (.PrevInSection) (.NextInSection) }} +<nav class="pager flex"> + {{- if .PrevInSection }} + <div class="pager__item pager__item--prev"> + <a class="pager__link" href="{{ .PrevInSection.RelPermalink }}" rel="prev"> + <span class="pager__subtitle">« {{ T "post_nav_prev" }}</span> + <p class="pager__title">{{ .PrevInSection.Title }}</p> + </a> + </div> + {{- end }} + {{- if .NextInSection }} + <div class="pager__item pager__item--next"> + <a class="pager__link" href="{{ .NextInSection.RelPermalink }}" rel="next"> + <span class="pager__subtitle">{{ T "post_nav_next" }} »</span> + <p class="pager__title">{{ .NextInSection.Title }}</p> + </a> + </div> + {{- end }} +</nav> +{{- end }} +{{- end }} diff --git a/themes/new_theme/layouts/partials/pagination.html b/themes/new_theme/layouts/partials/pagination.html index 82ad195..8cf40d5 100644 --- a/themes/new_theme/layouts/partials/pagination.html +++ b/themes/new_theme/layouts/partials/pagination.html @@ -1,11 +1,13 @@ -{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} -<div class="pagination clearfix"> +{{- if or (.Paginator.HasPrev) (.Paginator.HasNext) }} +<div class="pagination"> {{- if .Paginator.HasPrev }} - <a class="pagination__item pagination__item--prev" href="{{ .Paginator.Prev.URL }}">«</a> + <a class="pagination__item pagination__item--prev btn" href="{{ .Paginator.Prev.URL }}">«</a> {{- end }} - <span class="pagination__item pagination__item--current">{{ .Paginator.PageNumber }}/{{ .Paginator.TotalPages }}</span> + <span class="pagination__item pagination__item--current"> + {{- .Paginator.PageNumber }}/{{ .Paginator.TotalPages -}} + </span> {{- if .Paginator.HasNext }} - <a class="pagination__item pagination__item--next" href="{{ .Paginator.Next.URL }}">»</a> + <a class="pagination__item pagination__item--next btn" href="{{ .Paginator.Next.URL }}">»</a> {{- end }} </div> -{{ end }}
\ No newline at end of file +{{- end }} diff --git a/themes/new_theme/layouts/partials/post_meta.html b/themes/new_theme/layouts/partials/post_meta.html new file mode 100644 index 0000000..f357ddb --- /dev/null +++ b/themes/new_theme/layouts/partials/post_meta.html @@ -0,0 +1,7 @@ +{{- $root := . -}} +{{- with .Param "post_meta" -}} + {{- range $field := . -}} + {{- $p := printf "post_meta/%s.html" $field -}} + {{- partial $p $root -}} + {{- end -}} +{{- end -}}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/post_meta/author.html b/themes/new_theme/layouts/partials/post_meta/author.html new file mode 100644 index 0000000..0ee0fc9 --- /dev/null +++ b/themes/new_theme/layouts/partials/post_meta/author.html @@ -0,0 +1,6 @@ +{{- if .Site.Author.name -}} +<div class="meta__item-author meta__item"> + {{ partial "svg/author.svg" (dict "class" "meta__icon") -}} + <span class="meta__text">{{ .Site.Author.name }}</span> +</div> +{{- end -}}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/post_meta/categories.html b/themes/new_theme/layouts/partials/post_meta/categories.html new file mode 100644 index 0000000..8ab4202 --- /dev/null +++ b/themes/new_theme/layouts/partials/post_meta/categories.html @@ -0,0 +1,16 @@ +{{- $taxo := "categories" -}} +{{- with .Param $taxo -}} +<div class="meta__item-categories meta__item"> + {{- partial "svg/category.svg" (dict "class" "meta__icon") -}} + <span class="meta__text"> + {{- range $index, $category := . }} + {{- $url := urls.Parse ($category | urlize) -}} + {{- $path := $url.Path -}} + {{- with $.Site.GetPage (printf "/%s/%s" $taxo $path) }} + {{- if gt $index 0 }}, {{ end -}} + <a class="meta__link" href="{{ .RelPermalink }}" rel="category">{{ .Title }}</a> + {{- end }} + {{- end }} + </span> +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/post_meta/date.html b/themes/new_theme/layouts/partials/post_meta/date.html new file mode 100644 index 0000000..24a6c32 --- /dev/null +++ b/themes/new_theme/layouts/partials/post_meta/date.html @@ -0,0 +1,13 @@ +{{- if not .Date.IsZero }} +<div class="meta__item-datetime meta__item"> + {{ partial "svg/time.svg" (dict "class" "meta__icon") -}} + <time class="meta__text" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> + {{- .Date.Format (.Site.Params.dateformat | default "January 02, 2006") -}} + </time> + {{- if ne .Date .Lastmod }} + <time class="meta__text" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">( + {{- T "meta_lastmod" }}: {{ .Lastmod.Format (.Site.Params.dateformat | default "January 02, 2006") -}} + )</time> + {{- end -}} +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/post_meta/translations.html b/themes/new_theme/layouts/partials/post_meta/translations.html new file mode 100644 index 0000000..34d1172 --- /dev/null +++ b/themes/new_theme/layouts/partials/post_meta/translations.html @@ -0,0 +1,10 @@ +{{- if .IsTranslated }} +<div class="meta__item-translations meta__item"> + <span class="meta__text"> + {{- T "meta_translations" }}: {{ range $index, $translation := .Translations }} + {{- if gt $index 0 }}, {{ end -}} + <a class="meta__link" href="{{ .RelPermalink }}">{{ .Lang | upper }}</a> + {{- end }} + </span> +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/post_tags.html b/themes/new_theme/layouts/partials/post_tags.html index 549c76b..f21f372 100644 --- a/themes/new_theme/layouts/partials/post_tags.html +++ b/themes/new_theme/layouts/partials/post_tags.html @@ -1,10 +1,14 @@ {{- if .Params.tags }} <div class="post__tags tags clearfix"> - <svg class="icon icon-tag" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m4.73135 3.3795002q0-.5597-.39604-.9557-.39604-.3961-.95577-.3961-.55974 0-.95578.3961-.39604.396-.39604.9557 0 .5598.39604.9558.39604.3961.95578.3961.55973 0 .95577-.3961.39604-.396.39604-.9558zm11.26865 6.0832q0 .5596998-.39076.9504998l-5.18548 5.196q-.41188.3908-.9610504.3908-.55974 0-.9505-.3908l-7.5511496-7.5616998q-.40132-.3907-.68119-1.0666-.27987-.6759-.27987-1.2357v-4.3934q0-.54920004.40132-.95050004.40132-.4013.9505-.4013h4.39339q.55974 0 1.23565.2799.67591.2798 1.07723.6812l7.55115 7.54060004q.39076.4118.39076.961z"/></svg> + {{ partial "svg/tag.svg" (dict "class" "tags__badge") }} <ul class="tags__list"> {{- range .Params.tags }} - <li class="tags__item"><a class="tags__link" href="/tags/{{ . | urlize }}/" rel="tag">{{ . }}</a></li> + <li class="tags__item"> + <a class="tags__link btn" href="{{ "tags/" | relLangURL }}{{ . | urlize }}/" rel="tag"> + {{- . -}} + </a> + </li> {{- end }} </ul> </div> -{{- end }}
\ No newline at end of file +{{- end }} diff --git a/themes/new_theme/layouts/partials/post_toc.html b/themes/new_theme/layouts/partials/post_toc.html new file mode 100644 index 0000000..2133247 --- /dev/null +++ b/themes/new_theme/layouts/partials/post_toc.html @@ -0,0 +1,8 @@ +{{ if .Param "toc" }} +<div class="post__toc toc"> + <div class="toc__title">{{ T "toc_title" }}</div> + <div class="toc__menu"> + {{ .TableOfContents }} + </div> +</div> +{{ end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/ranklist.html b/themes/new_theme/layouts/partials/ranklist_elasticlunr.html index 5c7786b..5c7786b 100644 --- a/themes/new_theme/layouts/partials/ranklist.html +++ b/themes/new_theme/layouts/partials/ranklist_elasticlunr.html diff --git a/themes/new_theme/layouts/partials/ranklist_fts5.html b/themes/new_theme/layouts/partials/ranklist_fts5.html new file mode 100644 index 0000000..69c0f39 --- /dev/null +++ b/themes/new_theme/layouts/partials/ranklist_fts5.html @@ -0,0 +1,152 @@ +<script src="/js/jquery.js" type="text/javascript"></script> +<script src="/js/url-search-params.js" type="text/javascript"></script> +<script src="/js/loadingoverlay.min.js" type="text/javascript"></script> +<script src="/js/require.js" type="text/javascript"></script> + +<script language="Javascript"> + + function escapeHtml( text ) { + return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">" ); + } + + function draw_ranklist( query, results ) { + var html = ''; + + if( results.length == 0 ) { + return "<p>No hits for query '" + query + "'...</p>"; + } else { + html += "<p>" + results.length + " hits found</p>"; + } + + var start = 1; + html += "<ol class=\"ranklist\" start=\"" + start + "\">"; + for( var i = 0; i < results.length; i++ ) { + var rank = results[i]; + var docid = rank['docid']; + var abstract = rank['abstract']; + var title = rank['title']; + if( title == '' ) { + title = 'No title'; + } + html += "<li>"; + html += "<div class='title'>" + html += "<a href=\"" + docid + "\">" + title + "</a></div>"; + if( abstract != '' ) { + html += "<div class='abstract'>" + abstract + "</div>"; + } + html += "</li>"; + } + html += "</ol>"; + + return html; + } + + function submitQuery( ) { + try { + if( window.location.pathname.includes( "/search/") ) { + var q = $( "#query" ).val( ); + executeQuery( q ); + return false; + } else { + return true; + } + } catch( e ) { + alert( e ); + } + } + + var index_loaded = false; + var SQL; + var db; + var stmt; + + function loadIndex( success, fail ) { + if( !index_loaded ) { + const xhr = new XMLHttpRequest( ); + xhr.open( 'GET', '/index/posts.db', true ); + xhr.responseType = 'arraybuffer'; + xhr.onload = e => { + if( ( xhr.status == 0 ) || ( xhr.status == 200 ) ) { + const uInt8Array = new Uint8Array( xhr.response ); + requirejs(["/js/sql-wasm.js"], function(initSqlJs) { + + SQL = initSqlJs( { + locateFile: file => `/js/${file}` + } ); + + initSqlJs( ).then( function( SQL ) { + db = new SQL.Database(uInt8Array); + stmt = db.prepare( "select uri as docid,title,snippet(posts, 2, '<b>', '</b>', '...', 50) as abstract from posts where posts MATCH @query ORDER BY bm25(posts)" ); + + index_loaded = true; + + success( ); + } ); + } ); + } else { + const uInt8Array = new Uint8Array( xhr.response ); + const decoder = new TextDecoder( ); + const msg = decoder.decode( uInt8Array ); + fail( xhr.status, xhr.statusText, msg ); + } + } + xhr.send( ); + } else { + success( ); + } + } + + function executeQuery( query ) { + $( "#query" ).LoadingOverlay( "show" ); + + loadIndex( + function( ) { + stmt.bind( {'@query' : query} ); + + var html; + try { + var results = []; + while( stmt.step( ) ) { + var row = stmt.getAsObject( ); + results.push( row ); + } + + html = draw_ranklist( query, results ); + } catch( e ) { + html = "<pre><font color='red'>There was an error executing the query '" + query + "', reason: " + e + "</font></pre>\n"; + } + + $( '#ranklist' ).html( html ); + + $( "#query" ).LoadingOverlay( "hide" ); + }, + function( status, statusText, msg ) { + var html = "<pre><font color='red'>There was an error executing the query '" + query + "', reason: " + status + " " + statusText + "</font></pre>\n"; + $( '#ranklist' ).html( html ); + $( "#query" ).LoadingOverlay( "hide" ); + } + ); + } + + $( window ).load( function( ) { + var paramsString = window.location.search; + var searchParams = new URLSearchParams( paramsString ); + if( searchParams.has( "q" ) ) { + var q = searchParams.get( "q" ) + $( "#query" ).val( q ); + executeQuery( q ); + } else { + // TODO: come up with something here + } // Show full page LoadingOverlay + } ); + + $( window ).unload( function( ) { + if( index_loaded ) { + stmt.free( ); + db.close( ); + index_loaded = false; + } + } ); +</script> +<div id="ranklist"> +</div> diff --git a/themes/new_theme/layouts/partials/sidebar.html b/themes/new_theme/layouts/partials/sidebar.html index 1147dd2..c4fd283 100644 --- a/themes/new_theme/layouts/partials/sidebar.html +++ b/themes/new_theme/layouts/partials/sidebar.html @@ -1,10 +1,22 @@ -<aside class="sidebar" itemscope="itemscope" itemtype="http://schema.org/WPSideBar"> - {{ partial "widgets/dataprotection.html" . }} - {{ partial "widgets/elasticlunr_search.html" . }} - {{ $section := .Section }} - {{ if or ( eq $section "blog" ) ( eq $section "" ) }} - {{ partial "widgets/recent.html" . }} - {{ partial "widgets/categories.html" . }} - {{ partial "widgets/taglist.html" . }} - {{ end }} +{{- $sidebar := false }} +{{- if eq .Kind "home" -}} + {{ $sidebar = (default .Site.Params.sidebar.home .Params.sidebar) }} +{{- else if eq .Kind "page" -}} + {{ $sidebar = (default .Site.Params.sidebar.single .Params.sidebar) }} +{{- else -}} + {{ $sidebar = (default .Site.Params.sidebar.list .Params.sidebar) }} +{{ end }} + +{{- if $sidebar -}} +<aside class="sidebar{{ if eq $sidebar "left" }} sidebar--left{{ end }}"> +{{- $root := . }} +{{- with (default .Site.Params.sidebar.widgets .Params.widgets) -}} + {{- range $widget := . }} + {{- $p := printf "widgets/%s.html" $widget }} + {{- partial $p $root }} + {{- end }} +{{- else }} + <p class="sidebar__warning"><strong>{{ T "sidebar_warning" }}:</strong><br>{{ T "sidebar_recommendation" }}</p> +{{- end }} </aside> +{{- end }} diff --git a/themes/new_theme/layouts/partials/svg/author.svg b/themes/new_theme/layouts/partials/svg/author.svg new file mode 100644 index 0000000..0be6d81 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/author.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-author" width="16" height="16" viewBox="0 0 12 16"><path d="M6 1c2.2 0 3.5 2 3.5 4.5C9.5 7 8.9 8.2 8 9c2.9.8 4 2.5 4 5v1H0v-1c0-2.5 1.1-4.2 4-5-.9-.8-1.5-2-1.5-3.5C2.5 3 3.8 1 6 1z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/bitbucket.svg b/themes/new_theme/layouts/partials/svg/bitbucket.svg new file mode 100644 index 0000000..0f10764 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/bitbucket.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-bitbucket" width="24" height="24" viewBox="0 0 256 231"><path d="M8.308 0A8.202 8.202 0 0 0 .106 9.516l34.819 211.373a11.155 11.155 0 0 0 10.909 9.31h167.04a8.202 8.202 0 0 0 8.201-6.89l34.82-213.752a8.202 8.202 0 0 0-8.203-9.514L8.308 0zm146.616 152.768h-53.315l-14.436-75.42h80.67l-12.919 75.42z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/category.svg b/themes/new_theme/layouts/partials/svg/category.svg new file mode 100644 index 0000000..89f9f21 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/category.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-category" width="16" height="16" viewBox="0 0 16 16"><path d="m7 2l1 2h8v11h-16v-13z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/email.svg b/themes/new_theme/layouts/partials/svg/email.svg new file mode 100644 index 0000000..8fd8467 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/email.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-mail" width="24" height="24" viewBox="0 0 416 288"><path d="m0 16v256 16h16 384 16v-16-256-16h-16-384-16zm347 16-139 92.5-139-92.5zm-148 125.5 9 5.5 9-5.5 167-111.5v210h-352v-210z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/facebook.svg b/themes/new_theme/layouts/partials/svg/facebook.svg new file mode 100644 index 0000000..24babe2 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/facebook.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-facebook" width="24" height="24" viewBox="0 0 352 352"><path d="m0 32v288c0 17.5 14.5 32 32 32h288c17.5 0 32-14.5 32-32v-288c0-17.5-14.5-32-32-32h-288c-17.5 0-32 14.5-32 32zm320 0v288h-83v-108h41.5l6-48h-47.5v-31c0-14 3.5-23.5 23.5-23.5h26v-43.5c-4.4-.6-19.8-1.5-37.5-1.5-36.9 0-62 22.2-62 63.5v36h-42v48h42v108h-155v-288z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/files.svg b/themes/new_theme/layouts/partials/svg/files.svg new file mode 100644 index 0000000..72af481 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/files.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-files" width="96" height="96" viewBox="0 0 384 384"><path d="m368 64h-224-16v16 288 16h16 224 16v-16-288-16zm-16 288h-192v-256h192zm-320-320h192v16h32v-32-16h-16-224-16v16 288 16h16 96v-32h-80zm144 272h160v-32h-160zm0-64h160v-32h-160zm0-64h160v-32h-160zm-128 64h64v-32h-64zm0-64h64v-32h-64zm0-64h64v-32h-64z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/github.svg b/themes/new_theme/layouts/partials/svg/github.svg new file mode 100644 index 0000000..e694a12 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/github.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-github" width="24" height="24" viewBox="0 0 384 374"><path d="m192 0c-106.1 0-192 85.8-192 191.7 0 84.7 55 156.6 131.3 181.9 9.6 1.8 13.1-4.2 13.1-9.2 0-4.6-.2-16.6-.3-32.6-53.4 11.6-64.7-25.7-64.7-25.7-8.7-22.1-21.3-28-21.3-28-17.4-11.9 1.3-11.6 1.3-11.6 19.3 1.4 29.4 19.8 29.4 19.8 17.1 29.3 44.9 20.8 55.9 15.9 1.7-12.4 6.7-20.8 12.2-25.6-42.6-4.8-87.5-21.3-87.5-94.8 0-20.9 7.5-38 19.8-51.4-2-4.9-8.6-24.3 1.9-50.7 0 0 16.1-5.2 52.8 19.7 15.3-4.2 31.7-6.4 48.1-6.5 16.3.1 32.7 2.2 48.1 6.5 36.7-24.8 52.8-19.7 52.8-19.7 10.5 26.4 3.9 45.9 1.9 50.7 12.3 13.4 19.7 30.5 19.7 51.4 0 73.7-44.9 89.9-87.7 94.6 6.9 5.9 13 17.6 13 35.5 0 25.6-.2 46.3-.2 52.6 0 5.1 3.5 11.1 13.2 9.2 76.2-25.5 131.2-97.3 131.2-182 0-105.9-86-191.7-192-191.7z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/gitlab.svg b/themes/new_theme/layouts/partials/svg/gitlab.svg new file mode 100644 index 0000000..1efadbe --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/gitlab.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-gitlab" width="24" height="24" viewBox="0 0 265 265"><path d="M128.075 236.075l47.104-144.97H80.97l47.104 144.97z M14.956 91.104L.642 135.16a9.752 9.752 0 0 0 3.542 10.903l123.891 90.012-113.12-144.97z M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0l-28.37 87.315z M241.194 91.104l14.314 44.056a9.752 9.752 0 0 1-3.543 10.903l-123.89 90.012 113.119-144.97z M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0l28.37 87.315z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/instagram.svg b/themes/new_theme/layouts/partials/svg/instagram.svg new file mode 100644 index 0000000..47bed7f --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/instagram.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-instagram" width="24" height="24" viewBox="0 0 256 256"><circle cx="193" cy="59" r="15"/><path fill-rule="evenodd" d="M101 0h54c41 0 58.4 3.9 74.5 17C256.2 37.5 256 74.8 256 97.7v60c0 26.7 0 60.4-26.5 81.4-16 13.4-33.5 16.9-74.5 16.9h-54c-41 0-57.5-3.5-74.5-16.9C1 218.9.5 186.3.1 160.5L0 155V97.7c0-23-.2-60.2 26.5-80.7C45 2 60 0 101 0zm4.9 23h44.3c45.8 0 58.3 3.5 70.3 17.5 11.8 13.2 12 30.1 12.5 62.9V156c.2 20.8.3 45.8-12.5 59.5-12 14-24.5 17.5-70.3 17.5h-44.3c-45.9 0-57.3-3.5-70.4-17.5-12.2-13-12.3-36.5-12.4-56.7v-55.6c.4-32.6.7-49.6 12.4-62.7C48 26.5 60 23 105.9 23zm19.6 144.5a42 42 0 1 0 0-84 42 42 0 0 0 0 84zm0 22.5a64.5 64.5 0 1 0 0-129 64.5 64.5 0 0 0 0 129z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/linkedin.svg b/themes/new_theme/layouts/partials/svg/linkedin.svg new file mode 100644 index 0000000..4fe2234 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/linkedin.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-linkedin" width="24" height="24" viewBox="0 0 352 352"><path d="M0,40v272c0,21.9,18.1,40,40,40h272c21.9,0,40-18.1,40-40V40c0-21.9-18.1-40-40-40H40C18.1,0,0,18.1,0,40z M312,32 c4.6,0,8,3.4,8,8v272c0,4.6-3.4,8-8,8H40c-4.6,0-8-3.4-8-8V40c0-4.6,3.4-8,8-8H312z M59.5,87c0,15.2,12.3,27.5,27.5,27.5 c15.2,0,27.5-12.3,27.5-27.5c0-15.2-12.3-27.5-27.5-27.5C71.8,59.5,59.5,71.8,59.5,87z M187,157h-1v-21h-45v152h47v-75 c0-19.8,3.9-39,28.5-39c24.2,0,24.5,22.4,24.5,40v74h47v-83.5c0-40.9-8.7-72-56.5-72C208.5,132.5,193.3,145.1,187,157z M64,288h47.5 V136H64V288z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/tag.svg b/themes/new_theme/layouts/partials/svg/tag.svg new file mode 100644 index 0000000..ccc7d50 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/tag.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-tag" width="16" height="16" viewBox="0 0 32 32"><path d="M32 19c0 1-1 2-1 2L21 31s-1 1-2 1-2-1-2-1L2 16c-1-1-1.4-2-1.4-2S0 12.5 0 11V3C0 1.5.8.8.8.8S1.5 0 3 0h8c1.5 0 3 .6 3 .6S15 1 16 2l15 15s1 1 1 2zM7 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/telegram.svg b/themes/new_theme/layouts/partials/svg/telegram.svg new file mode 100644 index 0000000..c22ab56 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/telegram.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-telegram" width="24" height="24" viewBox="0 0 132 110"><path fill="#ddd" d="M50 103c-4 0-3-1-5-5L34 60l88-52"/><path fill="#aaa" d="M50 103c3 0 4-1 6-3l16-16-20-12"/><path fill="#fff" d="M52 72l48 36c6 3 10 2 11-5l20-93c2-8-3-11-8-9L7 45c-8 4-8 8-1 10l29 9 69-43c3-2 6-1 4 1"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/time.svg b/themes/new_theme/layouts/partials/svg/time.svg new file mode 100644 index 0000000..b6c6e96 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/time.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-time" width="16" height="14" viewBox="0 0 30 28"><path d="M15 0C7 0 1 6 1 14s6 14 14 14 14-6 14-14S23 0 15 0zm0 25C9 25 4 20 4 14S9 3 15 3s11 5 11 11-5 11-11 11zm1-18h-2v8.4l6.8 4.4L22 18l-6-3.8V7z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/svg/twitter.svg b/themes/new_theme/layouts/partials/svg/twitter.svg new file mode 100644 index 0000000..a78e073 --- /dev/null +++ b/themes/new_theme/layouts/partials/svg/twitter.svg @@ -0,0 +1 @@ +<svg class="{{ with .class }}{{ . }} {{ end }}icon icon-twitter" width="24" height="24" viewBox="0 0 384 312"><path d="m384 36.9c-14.1 6.3-29.3 10.5-45.2 12.4 16.3-9.7 28.8-25.2 34.6-43.6-15.2 9-32.1 15.6-50 19.1-14.4-15.2-34.9-24.8-57.5-24.8-43.5 0-78.8 35.3-78.8 78.8 0 6.2.7 12.2 2 17.9-65.5-3.3-123.5-34.6-162.4-82.3-6.7 11.6-10.6 25.2-10.6 39.6 0 27.3 13.9 51.4 35 65.6-12.9-.4-25.1-4-35.7-9.9v1c0 38.2 27.2 70 63.2 77.2-6.6 1.8-13.6 2.8-20.8 2.8-5.1 0-10-.5-14.8-1.4 10 31.3 39.1 54.1 73.6 54.7-27 21.1-60.9 33.7-97.8 33.7-6.4 0-12.6-.4-18.8-1.1 34.9 22.4 76.3 35.4 120.8 35.4 144.9 0 224.1-120 224.1-224.1 0-3.4-.1-6.8-.2-10.2 15.4-11.1 28.7-25 39.3-40.8z"/></svg>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/categories.html b/themes/new_theme/layouts/partials/widgets/categories.html index 7b93a4e..4998c44 100644 --- a/themes/new_theme/layouts/partials/widgets/categories.html +++ b/themes/new_theme/layouts/partials/widgets/categories.html @@ -1,16 +1,17 @@ -{{- if .Site.Params.widgets.categories }} -{{- if isset .Site.Taxonomies "categories" }} -{{- if not (eq (len .Site.Taxonomies.categories) 0) }} +{{- $categories := .Site.Taxonomies.categories }} +{{- if gt (len $categories) 0 }} <div class="widget-categories widget"> - <h4 class="widget__title">Categories</h4> + <h4 class="widget__title">{{ T "categories_title" }}</h4> <div class="widget__content"> <ul class="widget__list"> - {{- range $name, $items := .Site.Taxonomies.categories }} - <li class="widget__item"><a class="widget__link" href="{{ $.Site.BaseURL }}categories/{{ $name | urlize | lower }}">{{ $name | title }}</a></li> + {{- range $name, $taxonomy := $categories }} + {{- with $.Site.GetPage (printf "/categories/%s" $name) }} + <li class="widget__item"> + <a class="widget__link" href="{{ .RelPermalink }}">{{ .Title }}</a> + </li> {{- end }} + {{- end }} </ul> </div> </div> {{- end }} -{{- end }} -{{- end }} diff --git a/themes/new_theme/layouts/partials/widgets/elasticlunr_search.html b/themes/new_theme/layouts/partials/widgets/elasticlunr_search.html index 9fa5b34..5da7a2a 100644 --- a/themes/new_theme/layouts/partials/widgets/elasticlunr_search.html +++ b/themes/new_theme/layouts/partials/widgets/elasticlunr_search.html @@ -1,15 +1,13 @@ -{{- if .Site.Params.widgets.search }} <h4 class="widget__title">Search</h4> <div class="widget-search widget"> <form class="widget-search__form" role="search" method="get" action="/search/"> <label> - <span class="screen-reader-text">Search for:</span> - <input class="widget-search__field" type="search" autocomplete="off" placeholder="SEARCH..." value="" id="query" name="q"> + <input class="widget-search__field" type="search" autocomplete="off" placeholder="{{ T "search_placeholder" }}" value="" id="query" name="q" aria-label="{{ T "search_placeholder" }}"> </label> <input class="widget-search__submit" type="submit" value="Search"> </form> </div> -{{- if ( eq .URL "/search/" ) }} +{{- if ( eq .Permalink "/search/" ) }} <script language="Javascript"> $( window ).load( function( ) { var paramsString = window.location.search; @@ -21,6 +19,3 @@ } ); </script> {{- end }} -{{- end }} - - diff --git a/themes/new_theme/layouts/partials/widgets/fts5_search.html b/themes/new_theme/layouts/partials/widgets/fts5_search.html new file mode 100644 index 0000000..7f58e32 --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/fts5_search.html @@ -0,0 +1,21 @@ +<h4 class="widget__title">Search</h4> +<div class="widget-search widget"> + <form id="search_form" class="widget-search__form" role="search" method="get" action="/search/" onsubmit="return submitQuery( );"> + <label> + <input class="widget-search__field" type="search" autocomplete="off" placeholder="{{ T "search_placeholder" }}" value="" id="query" name="q" aria-label="{{ T "search_placeholder" }}"> + </label> + <input class="widget-search__submit" type="submit" value="Search"> + </form> +</div> +{{- if ( eq .Permalink "/search/" ) }} +<script language="Javascript"> + $( window ).load( function( ) { + var paramsString = window.location.search; + var searchParams = new URLSearchParams( paramsString ); + if( searchParams.has( "q" ) ) { + $( "#query" ).val( searchParams.get( "q" ) ); + $( "#query" ).removeAttr( "placeholder" ); + } + } ); +</script> +{{- end }} diff --git a/themes/new_theme/layouts/partials/widgets/languages.html b/themes/new_theme/layouts/partials/widgets/languages.html new file mode 100644 index 0000000..e54adb1 --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/languages.html @@ -0,0 +1,20 @@ +{{- $translations := .Site.Home.AllTranslations }} +{{- if and .Site.IsMultiLingual (gt (len $translations) 0) }} +<div class="widget-languages widget"> + <h4 class="widget__title">{{ T "languages_title" }}</h4> + <div class="widget__content"> + <ul class="widget__list"> + {{- range $translations }} + <li class="widget__item"> + <a class="widget-languages__link widget__link" href="{{ .RelPermalink }}"> + <span class="widget-languages__link-btn widget__link-btn btn">{{ .Language | upper }}</span> + {{- with .Language.LanguageName }} + <span class="widget-languages__link-text widget__link-text">{{ . | title | humanize }}</span> + {{- end }} + </a> + </li> + {{- end }} + </ul> + </div> +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/recent.html b/themes/new_theme/layouts/partials/widgets/recent.html index 6aaee19..c264062 100644 --- a/themes/new_theme/layouts/partials/widgets/recent.html +++ b/themes/new_theme/layouts/partials/widgets/recent.html @@ -1,9 +1,12 @@ -{{- if .Site.Params.widgets.recent_articles }} +{{- $recent := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} +{{- $recent_num := (.Site.Params.widgets.recent_num | default 10) }} + +{{- if $recent }} <div class="widget-recent widget"> - <h4 class="widget__title">Recent Posts</h4> + <h4 class="widget__title">{{ T "recent_title" }}</h4> <div class="widget__content"> <ul class="widget__list"> - {{- range first 10 (where .Site.Pages "Section" "blog") }} + {{- range first $recent_num $recent }} <li class="widget__item"><a class="widget__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li> {{- end }} </ul> diff --git a/themes/new_theme/layouts/partials/widgets/search.html b/themes/new_theme/layouts/partials/widgets/search.html new file mode 100644 index 0000000..d6b1652 --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/search.html @@ -0,0 +1,9 @@ +<div class="widget-search widget"> + <form class="widget-search__form" role="search" method="get" action="https://google.com/search"> + <label> + <input class="widget-search__field" type="search" placeholder="{{ T "search_placeholder" }}" value="" name="q" aria-label="{{ T "search_placeholder" }}"> + </label> + <input class="widget-search__submit" type="submit" value="Search"> + <input type="hidden" name="sitesearch" value="{{ .Site.BaseURL }}" /> + </form> +</div>
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/sidemenu.html b/themes/new_theme/layouts/partials/widgets/sidemenu.html new file mode 100644 index 0000000..2369233 --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/sidemenu.html @@ -0,0 +1,14 @@ +{{ if .Site.Menus.side }} +<div class="widget-sidemenu widget"> + <h4 class="widget__title">{{ T "sidemenu_title" }}</h4> + <nav class="widget__content"> + <ul class="widget__list"> + {{ range .Site.Menus.side }} + <li class="widget__item"> + <a class="widget__link" href="{{ .URL }}">{{ .Name }}</a> + </li> + {{ end }} + </ul> + </nav> +</div> +{{ end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/social.html b/themes/new_theme/layouts/partials/widgets/social.html new file mode 100644 index 0000000..7f8faa9 --- /dev/null +++ b/themes/new_theme/layouts/partials/widgets/social.html @@ -0,0 +1,90 @@ +{{- if .Site.Params.widgets.social }} +<div class="widget-social widget"> + <h4 class="widget-social__title widget__title">{{ T "social_title" }}</h4> + <div class="widget-social__content widget__content"> + {{- with .Site.Params.widgets.social.facebook }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="Facebook" rel="noopener noreferrer" href="https://facebook.com/{{ . }}" target="_blank"> + {{ partial "svg/facebook.svg" (dict "class" "widget-social__link-icon") }} + <span>Facebook</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.twitter }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="Twitter" rel="noopener noreferrer" href="https://twitter.com/{{ . }}" target="_blank"> + {{ partial "svg/twitter.svg" (dict "class" "widget-social__link-icon") }} + <span>Twitter</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.instagram }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="Instagram" rel="noopener noreferrer" href="https://www.instagram.com/{{ . }}" target="_blank"> + {{ partial "svg/instagram.svg" (dict "class" "widget-social__link-icon") }} + <span>Instagram</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.linkedin }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="LinkedIn" rel="noopener noreferrer" href="https://linkedin.com/in/{{ . }}" target="_blank"> + {{ partial "svg/linkedin.svg" (dict "class" "widget-social__link-icon") }} + <span>LinkedIn</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.telegram }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="Telegram" rel="noopener noreferrer" href="https://t.me/{{ . }}" target="_blank"> + {{ partial "svg/telegram.svg" (dict "class" "widget-social__link-icon") }} + <span>Telegram</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.github }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="GitHub" rel="noopener noreferrer" href="https://github.com/{{ . }}" target="_blank"> + {{ partial "svg/github.svg" (dict "class" "widget-social__link-icon") }} + <span>GitHub</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.gitlab }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="GitLab" rel="noopener noreferrer" href="https://gitlab.com/{{ . }}" target="_blank"> + {{ partial "svg/gitlab.svg" (dict "class" "widget-social__link-icon") }} + <span>GitLab</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.bitbucket }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="Bitbucket" rel="noopener noreferrer" href="https://bitbucket.org/{{ . }}" target="_blank"> + {{ partial "svg/bitbucket.svg" (dict "class" "widget-social__link-icon") }} + <span>Bitbucket</span> + </a> + </div> + {{- end }} + {{- with .Site.Params.widgets.social.email }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="Email" href="mailto:{{ . }}"> + {{ partial "svg/email.svg" (dict "class" "widget-social__link-icon") }} + <span>{{ . }}</span> + </a> + </div> + {{- end }} + + {{ range .Site.Params.widgets.social.custom }} + <div class="widget-social__item widget__item"> + <a class="widget-social__link widget__link btn" title="{{ .title }}" rel="noopener noreferrer" href="{{ .url }}" target="_blank"> + {{- if .icon }} + {{ partial .icon (dict "class" "widget-social__link-icon") }} + {{- end }} + <span>{{ .title }}</span> + </a> + </div> + {{ end }} + </div> +</div> +{{- end }}
\ No newline at end of file diff --git a/themes/new_theme/layouts/partials/widgets/taglist.html b/themes/new_theme/layouts/partials/widgets/taglist.html index 966205a..9b6046b 100644 --- a/themes/new_theme/layouts/partials/widgets/taglist.html +++ b/themes/new_theme/layouts/partials/widgets/taglist.html @@ -1,14 +1,15 @@ -{{- if .Site.Params.widgets.tags }} -{{- if isset .Site.Taxonomies "tags" }} -{{- if not (eq (len .Site.Taxonomies.tags) 0) }} +{{- $tags := .Site.Taxonomies.tags }} +{{- if gt (len $tags) 0 }} <div class="widget-taglist widget"> - <h4 class="widget__title">Tags</h4> + <h4 class="widget__title">{{ T "tags_title" }}</h4> <div class="widget__content"> - {{- range $name, $items := .Site.Taxonomies.tags }} - <a class="widget__link widget__link--taglist" href="{{ $.Site.BaseURL }}tags/{{ $name | urlize | lower }}" title="{{ $name }}">{{ $name }}</a> + {{- range $name, $taxonomy := $tags }} + {{- with $.Site.GetPage (printf "/tags/%s" $name) }} + <a class="widget-taglist__link widget__link btn" href="{{ .RelPermalink }}" title="{{ .Title }}"> + {{- .Title -}}{{- if .Site.Params.widgets.tags_counter }} ({{ $taxonomy.Count }}){{ end -}} + </a> {{- end }} + {{- end }} </div> </div> {{- end }} -{{- end }} -{{- end }}
\ No newline at end of file |