Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vaga/hugo-theme-m10c.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien CASTERS <fabien@vaga.io>2020-07-16 21:57:33 +0300
committerFabien <vaga@users.noreply.github.com>2020-10-08 13:24:48 +0300
commit143e072fa91595d85dda9b16859edaa56d35528e (patch)
tree1360b65163e3c99d17fd01f30218e1062b40f92b /layouts
parent476c36d260427d1b7a0aab768af18021db240cda (diff)
Add custom menu
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html8
-rw-r--r--layouts/_default/list.html7
-rw-r--r--layouts/_default/single.html14
3 files changed, 21 insertions, 8 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 36a1b31..923d10e 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -19,6 +19,14 @@
<header class="app-header">
<a href="{{ .Site.BaseURL }}"><img class="app-header-avatar" src="{{ .Site.Params.avatar | default "avatar.jpg" | relURL }}" alt="{{ .Site.Params.author | default "John Doe" }}" /></a>
<h1>{{ .Site.Title }}</h1>
+ {{- with .Site.Menus.main }}
+ <nav class="app-header-menu">
+ -
+ {{- range . }}
+ <a href="{{ .URL }}">{{ .Name }}</a> -
+ {{- end }}
+ </nav>
+ {{- end }}
<p>{{ .Site.Params.description | default "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vehicula turpis sit amet elit pretium." }}</p>
<div class="app-header-social">
{{ range .Site.Params.social }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 392c5e2..8a0c7c7 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -2,12 +2,15 @@
<article>
<h1>{{ .Title }}</h1>
<ul class="posts-list">
- {{ range $index, $element := .Paginator.Pages }}
+ {{ range where .Paginator.Pages "Type" "!=" "page" }}
<li class="posts-list-item">
<a class="posts-list-item-title" href="{{ .Permalink }}">{{ .Title }}</a>
<span class="posts-list-item-description">
- {{ partial "icon.html" (dict "ctx" $ "name" "clock") }} {{ .ReadingTime }} min read -
+ {{ partial "icon.html" (dict "ctx" $ "name" "calendar") }}
{{ .PublishDate.Format "Jan 2, 2006" }}
+ -
+ {{ partial "icon.html" (dict "ctx" $ "name" "clock") }}
+ {{ .ReadingTime }} min read
</span>
</li>
{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 8dcd8cc..30da500 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -2,6 +2,7 @@
<article class="post">
<header class="post-header">
<h1 class ="post-title">{{ .Title }}</h1>
+ {{- if ne .Type "page" }}
<div class="post-meta">
<div>
{{ partial "icon.html" (dict "ctx" $ "name" "calendar") }}
@@ -11,17 +12,18 @@
{{ partial "icon.html" (dict "ctx" $ "name" "clock") }}
{{ .ReadingTime }} min read
</div>
- {{- with .Params.tags -}}
+ {{- with .Params.tags }}
<div>
{{ partial "icon.html" (dict "ctx" $ "name" "tag") }}
- {{ range . -}}
- {{- with $.Site.GetPage (printf "/%s/%s" "tags" . ) -}}
+ {{- range . -}}
+ {{ with $.Site.GetPage (printf "/%s/%s" "tags" . ) }}
<a class="tag" href="{{ .Permalink }}">{{ .Title }}</a>
- {{- end -}}
- {{- end -}}
+ {{- end }}
+ {{- end }}
</div>
- {{- end -}}
+ {{- end }}
</div>
+ {{- end }}
</header>
<div class="post-content">
{{ .Content }}