Skip to content

Commit f2cb542

Browse files
committed
Add more sidebar hooks
And a Netflify badge if deployed by them.
1 parent 1ebed17 commit f2cb542

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ When the fix for [#2549](https://github.com/spf13/hugo/issues/2549) is released
2626

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

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ if getenv "REPOSITORY_URL" -}}
2+
<div style="margin-left: 20px; margin-top: 20px">
3+
<a href="https://www.netlify.com">
4+
<img src="https://www.netlify.com/img/global/badges/netlify-dark.svg"/>
5+
</a>
6+
</div>
7+
{{ end }}

layouts/_default/baseof.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
</span>
1818
</a>
1919
<div class="tocify-wrapper">
20-
<img src='{{ relURL "images/logo.png" }}' />
20+
{{ partial "hook_left_sidebar_start.html" . }}
21+
{{ partial "hook_left_sidebar_logo.html" . }}
2122
{{ with .Site.Params.language_tabs }}
2223
<div class="lang-selector">
2324
{{ range . }}
@@ -46,6 +47,7 @@ <h3 class="translations-title">{{ T "translations" (len .Translations ) }}</h3>
4647
{{ end}}
4748
</ul>
4849
{{ end}}
50+
{{ partial "hook_left_sidebar_end.html" . }}
4951
</div>
5052
<div class="page-wrapper">
5153
<div class="dark-box"></div>

layouts/partials/hook_left_sidebar_end.html

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<img src='{{ relURL "images/logo.png" }}' />

layouts/partials/hook_left_sidebar_start.html

Whitespace-only changes.

0 commit comments

Comments
 (0)