Skip to content

Commit

Permalink
Add the ability to link static elements in the nav
Browse files Browse the repository at this point in the history
  • Loading branch information
mateimicu committed Apr 27, 2018
1 parent e716e5f commit 4f8a2d4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ tag ="tags"

[blackfriday]
hrefTargetBlank = true

```

To change color of titles, add in static/css/custom.css
Expand All @@ -95,6 +96,18 @@ To align images, add #c for center, #r/l for right/left.
![](/img/1/image.jpg#c)
```

## Add static links
Follow this example to add static links

```toml
[[params.static]]
title = "Slides"
url = "http://slides.mateimicu.com"
[[params.static]]
title = "Slides2"
url = "http://slides.mateimicu.com/2"
```

## Related Articles

To include related articles in the bottom of the content, set params.info.related to true.
Expand Down Expand Up @@ -129,4 +142,4 @@ The following resources are included in the theme:

## Author

[Emir Ribic](https://github.com/ribice)
[Emir Ribic](https://github.com/ribice)
20 changes: 16 additions & 4 deletions layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</div>
</nav>

{{ if (isset .Site.Params "sections" ) }}
<nav class="nav">
<nav class="nav">
{{ if (isset .Site.Params "sections" ) }}
<div class="nav-left">
{{- range $section, $printable := .Site.Params.sections -}}
{{- if $printable -}}
Expand All @@ -32,7 +32,19 @@ <h2 class="title is-5">{{$printable}}</h2>
{{- end -}}
{{- end -}}
</div>
</nav>
{{ end }}
{{ end }}

{{ if (isset .Site.Params "static" ) }}
<div class="nav-right">
{{- range .Site.Params.static -}}
<a class="nav-item" href="{{ .url }}">
<h2 class="title is-5">{{ .title }}</h2>
</a>
{{- end -}}
</div>
{{ end }}
</nav>


</div>
</section>

0 comments on commit 4f8a2d4

Please sign in to comment.