Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/parsiya/Hugo-Octopress.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsiya@gmail.com <parsiya@gmail.com>2016-07-31 21:50:33 +0300
committerparsiya@gmail.com <parsiya@gmail.com>2016-07-31 21:50:33 +0300
commit16e73c1fde2317bebfb93b5942b572db4d5831e6 (patch)
tree6a665ed7541ebbad77b1d98e7955e1436301cc06
parenta700f9a0cbb002abf0403700412eda26094aaed4 (diff)
Add control to make sidebar menu links open in a new window
-rw-r--r--README.md2
-rw-r--r--layouts/partials/sidebar.html5
2 files changed, 5 insertions, 2 deletions
diff --git a/README.md b/README.md
index 27e717b..ac9af1c 100644
--- a/README.md
+++ b/README.md
@@ -254,6 +254,8 @@ This menu can be enabled by setting the `sidebar_menu_enabled` to `true` in conf
URL = "/categories/hugo/"
weight = 1
+ * If the `sidebarNewWindow` parameter in config file to `true` to open the sidebar links in a new window. If this parameter does not exist or set to `false` then links open in the same window (default behavior).
+
### <a name="sidebarrecent"></a>Recent posts
Last x recent posts can be displayed in the sidebar. This number can be set in the config file using the `sidebarRecentLimit`. To hide this section either remove `sidebarRecentLimit` from the config file or set it to zero.
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 739d365..dd218af 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -39,7 +39,8 @@
</ul>
<!-- sidebar menu - items are read from the config file
- first we check if it is enabled in config file and then start adding the items -->
+ first we check if it is enabled in config file and then start adding the items
+ if Site.Params.sidebarNewWindow exists and is set to true then open these links in a new window -->
{{ if eq .Site.Params.sidebar_menu_enabled true }}
<section class="odd">
@@ -48,7 +49,7 @@
{{ end }}
{{ range .Site.Menus.sidebar }}
<li>
- <a href="{{ .URL | absURL }}" title="{{ .Name }}">{{ .Name }}</a>
+ <a href="{{ .URL | absURL }}" title="{{ .Name }}" {{ if eq $.Site.Params.sidebarNewWindow true }} target="_blank" {{ end }}>{{ .Name }}</a>
</li>
{{ end }}
</section>