Skip to content

Commit

Permalink
Add more sidebar hooks
Browse files Browse the repository at this point in the history
And a Netflify badge if deployed by them.
  • Loading branch information
bep committed Apr 29, 2017
1 parent 1ebed17 commit f2cb542
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -26,6 +26,9 @@ When the fix for [#2549](https://github.com/spf13/hugo/issues/2549) is released

* `partials/hook_head_end.html` is inserted right before the `head` end tag. Useful for additional styles etc.
* `partials/hook_body_end.html` which should be clear by its name.
* `partials/hook_left_sidebar_start.html` the start of the left sidebar
* `partials/hook_left_sidebar_end.html` the end of the left sidebar
* `partials/hook_left_sidebar_logo.html` the log `img` source

The styles and Javascript import are also put in each partial and as such can be overridden if really needed:

Expand Down
7 changes: 7 additions & 0 deletions exampleSite/layouts/partials/hook_left_sidebar_end.html
@@ -0,0 +1,7 @@
{{ if getenv "REPOSITORY_URL" -}}
<div style="margin-left: 20px; margin-top: 20px">
<a href="https://www.netlify.com">
<img src="https://www.netlify.com/img/global/badges/netlify-dark.svg"/>
</a>
</div>
{{ end }}
4 changes: 3 additions & 1 deletion layouts/_default/baseof.html
Expand Up @@ -17,7 +17,8 @@
</span>
</a>
<div class="tocify-wrapper">
<img src='{{ relURL "images/logo.png" }}' />
{{ partial "hook_left_sidebar_start.html" . }}
{{ partial "hook_left_sidebar_logo.html" . }}
{{ with .Site.Params.language_tabs }}
<div class="lang-selector">
{{ range . }}
Expand Down Expand Up @@ -46,6 +47,7 @@ <h3 class="translations-title">{{ T "translations" (len .Translations ) }}</h3>
{{ end}}
</ul>
{{ end}}
{{ partial "hook_left_sidebar_end.html" . }}
</div>
<div class="page-wrapper">
<div class="dark-box"></div>
Expand Down
Empty file.
1 change: 1 addition & 0 deletions layouts/partials/hook_left_sidebar_logo.html
@@ -0,0 +1 @@
<img src='{{ relURL "images/logo.png" }}' />
Empty file.

0 comments on commit f2cb542

Please sign in to comment.