diff options
author | Jordan Kaye <jordan.kaye2@gmail.com> | 2020-12-13 23:29:20 +0300 |
---|---|---|
committer | Jordan Kaye <jordan.kaye2@gmail.com> | 2020-12-13 23:56:25 +0300 |
commit | 203d4932183de989a3f725458a60307b12c1c3e5 (patch) | |
tree | 3fd96eb3ce227d5c8b7c0e08bb7bce025fa225ec | |
parent | 6458a0b33c6259dee654c0c7100859f81ecc5627 (diff) |
Added a social icons section to the sidebar
[[menu.icons]] can now be used to specify icons that will be displayed
after the site's description, but before the main menu items.
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | layouts/partials/sidebar-content.html | 14 | ||||
-rw-r--r-- | static/css/strange-case.css | 4 |
3 files changed, 23 insertions, 7 deletions
@@ -49,14 +49,22 @@ This text will appear in a free paragraph below the Title & Description and abov sidebarFreeText = "A optional paragraph of free text. Set to blank in config.toml to clear..." -You can also include useful menu links by including `"menu=main"` items in your `config.toml`. Example: +You can include clickable icons (e.g. for social networks )by including `"menu=icons"` items in your `config.toml`. Example: + + [[menu.icons]] + name = "GitHub" + post = "<img src=\"/images/github.png\"" + url = "https://github.com" + +You can optionally use the `post` var to include HTML after the `name` in the resulting links. +You can include useful menu links by including `"menu=main"` items in your `config.toml`. Example: [[menu.main]] name = "Hugo" post = "<span class='glyphicon glyphicon-fire'></span>" url = "http://gohugo.io" -You can optionally use the `pre` and `post` vars to include HTML before or after the `name` in the resulting links. +You can optionally use the `post` var to include HTML after the `name` in the resulting links. You can use the `"contact_email"` field in `[params]` to set a mailto: link the in the sidebar. Leave blank if you don't want it. diff --git a/layouts/partials/sidebar-content.html b/layouts/partials/sidebar-content.html index a76501d..dd714c7 100644 --- a/layouts/partials/sidebar-content.html +++ b/layouts/partials/sidebar-content.html @@ -10,11 +10,17 @@ </div> {{ end }} + <ul class="sidebar-menus sidebar-icons"> + {{ range .Site.Menus.icons }} + <li><a href="{{.URL}}">{{ .Post }}</a></li> + {{end}} + </ul> + <ul class="sidebar-menus"> - {{ range .Site.Menus.main }} - <li>» <a href="{{.URL}}">{{ .Name }}</a> {{ .Post }}</li> - {{end}} - </ul> + {{ range .Site.Menus.main }} + <li>» <a href="{{.URL}}">{{ .Name }}</a>{{ .Post }}</li> + {{end}} + </ul> <div class="sidebar-recent hidden-xs"> <p>Recent Posts:</p> diff --git a/static/css/strange-case.css b/static/css/strange-case.css index f6d4d55..880d713 100644 --- a/static/css/strange-case.css +++ b/static/css/strange-case.css @@ -76,7 +76,6 @@ img { /* SIDEBAR */ - .sidebar { padding: 2em; font-size: 1.3em; @@ -98,6 +97,9 @@ img { list-style: none; font-size:1em; } +.sidebar .sidebar-icons li { + display: inline-block; +} .sidebar .sidebar-recent { margin-top: 1.5em; } |