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

github.com/cntrump/hugo-notepadium.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvvveiii <cntrump@gmail.com>2020-01-02 02:27:21 +0300
committervvveiii <cntrump@gmail.com>2020-01-02 02:27:21 +0300
commitba8b43e22897dbc9c150f63267fbe046df013f9b (patch)
treeb52e132e45676be52909d82ea963b565069c9472 /README.md
parent45f64b3d1bdd9d14a612751b0df7646ff8154c4a (diff)
using navigation-items.html partial rewrite header right side items.
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 21 insertions, 7 deletions
diff --git a/README.md b/README.md
index 2293aa4..1bf8fe5 100644
--- a/README.md
+++ b/README.md
@@ -262,22 +262,36 @@ On user-side:
### Custom header right items
-Create an user-side partial: `header-right.html`
+Create an user-side partial: `navigation-items.html`
```
.
└── layouts
└── partials
- └── header-right.html
+ └── navigation-items.html
```
-An example header-right.html:
+An example navigation-items.html:
```html
-<a class="article-tag" href="{{- `/tags/ios/` | relURL -}}">iOS</a>
-<a class="article-tag" href="{{- `/tags/swift/` | relURL -}}">Swift</a>
-<a class="article-tag" href="{{- `/tags/` | relURL -}}">Tags</a>
-<a class="article-tag" href="https://github.com/cntrump" target="_blank">Github</a>
+{{- $nav := . -}}
+{{- if or $nav.showCategories $nav.showTags $nav.custom -}}
+<div class="nav-wrap"><div class="nav">
+ {{- if $nav.showCategories -}}
+ <a class="nav-item" href="{{- `/categories/` | relURL -}}">Categories</a>
+ {{- end -}}
+ {{- if $nav.showTags -}}
+ <a class="nav-item" href="{{- `/tags/` | relURL -}}">Tags</a>
+ {{- end -}}
+ {{- range $nav.custom -}}
+ {{- $url := .url | safeURL -}}
+ {{- if strings.HasPrefix $url "/" -}}{{- $url = ($url | relURL) -}}{{- end -}}
+ <a class="nav-item" href="{{- $url -}}"
+ {{- if strings.HasPrefix $url "http" -}}target="_blank"
+ {{- end -}}>{{- .title -}}</a>
+ {{- end -}}
+</div></div>
+{{- end -}}
```
![](https://raw.githubusercontent.com/cntrump/hugo-notepadium/master/images/04.png)