template
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{{ "<!-- about me -->" | safeHTML }}
|
||||
<div class="widget text-center">
|
||||
{{ with site.GetPage "/about" }}
|
||||
<span class="widget-title">{{ i18n `about_me` }}</span>
|
||||
{{ if .Params.image }}
|
||||
<img loading="lazy" class="mb-4 rounded-circle w-100" style="max-width:150px" src="{{ .Params.image | absURL }}" alt="Author">
|
||||
{{ else if .Params.email }}
|
||||
<img loading="lazy" class="mb-4 rounded-circle w-100" style="max-width:150px" src="https://www.gravatar.com/avatar/{{ md5 .Params.email }}?s=150&pg&d=identicon">
|
||||
{{ end }}
|
||||
<p class="text-uppercase small mb-2">{{ i18n `my_name_is` }}</p>
|
||||
<h1 class="h4 text-primary font-primary mb-3">{{ .Params.name }}</h1>
|
||||
<div class="mb-0 mx-auto" style="max-width:460px">{{ .Summary }} <a href="{{ .Permalink }}" aria-label="About me" class="text-underline d-inline-block">{{ i18n `read_more` }}</a></div>
|
||||
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
{{ "<!-- categories -->" | safeHTML }}
|
||||
<div class="widget">
|
||||
<span class="widget-title">{{ i18n "categories" }}</span>
|
||||
|
||||
{{ if isset site.Taxonomies "categories" }}
|
||||
{{ if not (eq (len site.Taxonomies.categories) 0) }}
|
||||
<ul class="sidebar-post-categories list-unstyled">
|
||||
{{ range $name, $items := site.Taxonomies.categories }}
|
||||
<li><a href="{{ `categories/` | absLangURL }}{{ $name | urlize | lower }}/">{{ $name | humanize }} <span>{{ len $items }}</span></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
{{ "<!-- latest post -->" | safeHTML }}
|
||||
<div class="widget">
|
||||
<span class="widget-title">{{ i18n `recent_post` }}</span>
|
||||
|
||||
<ul class="sidebar-recent-post list-unstyled">
|
||||
{{ $related := ( where site.RegularPages "Type" "in" site.Params.mainSections ) | intersect (where site.Pages ".Title" "!=" .Title) | union (site.RegularPages.Related . ) }}
|
||||
{{ range first 3 $related }}
|
||||
<li class="recent-post-item">
|
||||
<div class="media">
|
||||
<div class="media-body mr-2">
|
||||
<h5><a href="{{ .Permalink }}">{{ .Title }}</a></h5>
|
||||
<span class="card-meta">
|
||||
<span class="card-meta-date">{{.PublishDate.Format "Jan 02, 2006"}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<a href="{{ .Permalink }}" class="recent-post-image">
|
||||
{{ range first 1 .Params.Images }}
|
||||
<img loading="lazy" class="img-fluid rounded-circle" src="{{ . | absURL }}">
|
||||
{{ end }}
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
{{ "<!-- Search -->" | safeHTML }}
|
||||
{{ if site.Params.search }}
|
||||
<div class="widget">
|
||||
<h5 class="widget-title"><span>{{ i18n "search" }}</span></h5>
|
||||
<form action="{{ `search`| relLangURL }}" class="widget-search">
|
||||
<input id="search-query" name="s" type="search" placeholder="{{ i18n `search_placeholder`}}">
|
||||
<button type="submit"><i class="ti-search"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{ "<!-- tags -->" | safeHTML }}
|
||||
<div class="widget">
|
||||
<span class="widget-title">{{ i18n "tags" }}</span>
|
||||
{{ if isset site.Taxonomies "tags" }}
|
||||
{{ if not (eq (len site.Taxonomies.tags) 0) }}
|
||||
<ul class="sidebar-post-tags list-unstyled list-inline">
|
||||
{{ range $name, $items := site.Taxonomies.tags }}
|
||||
<li class="list-inline-item"><a href="{{ `tags/` | absLangURL }}{{ $name | urlize | lower }}/">{{ $name | humanize }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- range .Widgets -}}
|
||||
{{- partial ( print "widgets/" . ) $.Scope -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user