initial commit
This commit is contained in:
17
themes/hugo-dpsg/layouts/partials/widgets/categories.html
Normal file
17
themes/hugo-dpsg/layouts/partials/widgets/categories.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- $categories := .Site.Taxonomies.categories }}
|
||||
{{- if gt (len $categories) 0 }}
|
||||
<div class="widget-categories widget">
|
||||
<h4 class="widget__title">{{ T "categories_title" }}</h4>
|
||||
<div class="widget__content">
|
||||
<ul class="widget__list">
|
||||
{{- 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 }}
|
||||
20
themes/hugo-dpsg/layouts/partials/widgets/languages.html
Normal file
20
themes/hugo-dpsg/layouts/partials/widgets/languages.html
Normal file
@@ -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 }}
|
||||
15
themes/hugo-dpsg/layouts/partials/widgets/recent.html
Normal file
15
themes/hugo-dpsg/layouts/partials/widgets/recent.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- $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">{{ T "recent_title" }}</h4>
|
||||
<div class="widget__content">
|
||||
<ul class="widget__list">
|
||||
{{- range first $recent_num $recent }}
|
||||
<li class="widget__item"><a class="widget__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
||||
9
themes/hugo-dpsg/layouts/partials/widgets/search.html
Normal file
9
themes/hugo-dpsg/layouts/partials/widgets/search.html
Normal file
@@ -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>
|
||||
14
themes/hugo-dpsg/layouts/partials/widgets/sidemenu.html
Normal file
14
themes/hugo-dpsg/layouts/partials/widgets/sidemenu.html
Normal file
@@ -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 }}
|
||||
90
themes/hugo-dpsg/layouts/partials/widgets/social.html
Normal file
90
themes/hugo-dpsg/layouts/partials/widgets/social.html
Normal file
@@ -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 }}
|
||||
15
themes/hugo-dpsg/layouts/partials/widgets/taglist.html
Normal file
15
themes/hugo-dpsg/layouts/partials/widgets/taglist.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- $tags := .Site.Taxonomies.tags }}
|
||||
{{- if gt (len $tags) 0 }}
|
||||
<div class="widget-taglist widget">
|
||||
<h4 class="widget__title">{{ T "tags_title" }}</h4>
|
||||
<div class="widget__content">
|
||||
{{- 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 }}
|
||||
Reference in New Issue
Block a user