Browse Source

feat: add support for hiding "Recent posts" block

master
luto 3 years ago
committed by Aurélien Baumann
parent
commit
c4f5e4ade9
  1. 4
      README.md
  2. 2
      layouts/partials/menu.html

4
README.md

@ -30,6 +30,10 @@ theme = "code-editor"
# rootlink specifies where Root in menu.html links to. If it's not set then baseurl will be used.
```
In addition to the required settings, you can customize this theme using the following keys within `[params]`:
* `codeeditor_menu_mostrecentposts`, defaults to `true`, whether to show the "Most recent posts" section within the menu
# Contributing
Contributions are welcome. Please refer to the [contributions guidelines](https://github.com/aubm/hugo-code-editor-theme/blob/master/CONTRIBUTING.md) for more information.

2
layouts/partials/menu.html

@ -1,4 +1,5 @@
<nav class="col-md-3">
{{ if $.Site.Params.codeeditor_menu_mostrecentposts | default true }}
<h3 class="home-link"><a href="{{ index .Site.Params "rootlink" | default .Site.BaseURL }}">{{ ( index $.Site.Data.translations (default $.Site.Params.locale "en-US") ).root }}</a></h3>
<div id="last-posts" class="open">
<h3 data-open="last-posts">{{ .Site.Title }} - {{ ( index $.Site.Data.translations (default $.Site.Params.locale "en-US") ).mostrecentposts }}</h3>
@ -8,6 +9,7 @@
{{ end }}
</ul>
</div>
{{ end }}
{{ with .Site.Taxonomies.tags }}
<div id="tags" class="open">

Loading…
Cancel
Save