From f2cb5423932c3542077daa77e24b4aa4effd6ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 29 Apr 2017 13:06:05 +0200 Subject: [PATCH] Add more sidebar hooks And a Netflify badge if deployed by them. --- README.md | 3 +++ exampleSite/layouts/partials/hook_left_sidebar_end.html | 7 +++++++ layouts/_default/baseof.html | 4 +++- layouts/partials/hook_left_sidebar_end.html | 0 layouts/partials/hook_left_sidebar_logo.html | 1 + layouts/partials/hook_left_sidebar_start.html | 0 6 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 exampleSite/layouts/partials/hook_left_sidebar_end.html create mode 100644 layouts/partials/hook_left_sidebar_end.html create mode 100644 layouts/partials/hook_left_sidebar_logo.html create mode 100644 layouts/partials/hook_left_sidebar_start.html diff --git a/README.md b/README.md index 5989b66..c482060 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/exampleSite/layouts/partials/hook_left_sidebar_end.html b/exampleSite/layouts/partials/hook_left_sidebar_end.html new file mode 100644 index 0000000..3fa7a7b --- /dev/null +++ b/exampleSite/layouts/partials/hook_left_sidebar_end.html @@ -0,0 +1,7 @@ +{{ if getenv "REPOSITORY_URL" -}} +
+ + + +
+{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index bdb57fb..456b40c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -17,7 +17,8 @@
- + {{ partial "hook_left_sidebar_start.html" . }} + {{ partial "hook_left_sidebar_logo.html" . }} {{ with .Site.Params.language_tabs }}
{{ range . }} @@ -46,6 +47,7 @@

{{ T "translations" (len .Translations ) }}

{{ end}} {{ end}} + {{ partial "hook_left_sidebar_end.html" . }}
diff --git a/layouts/partials/hook_left_sidebar_end.html b/layouts/partials/hook_left_sidebar_end.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/hook_left_sidebar_logo.html b/layouts/partials/hook_left_sidebar_logo.html new file mode 100644 index 0000000..f88cd96 --- /dev/null +++ b/layouts/partials/hook_left_sidebar_logo.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/partials/hook_left_sidebar_start.html b/layouts/partials/hook_left_sidebar_start.html new file mode 100644 index 0000000..e69de29