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

github.com/ExchangeRate-API/strange-case.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Kaye <jordan.kaye2@gmail.com>2020-12-13 23:29:20 +0300
committerJordan Kaye <jordan.kaye2@gmail.com>2020-12-13 23:56:25 +0300
commit203d4932183de989a3f725458a60307b12c1c3e5 (patch)
tree3fd96eb3ce227d5c8b7c0e08bb7bce025fa225ec
parent6458a0b33c6259dee654c0c7100859f81ecc5627 (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.md12
-rw-r--r--layouts/partials/sidebar-content.html14
-rw-r--r--static/css/strange-case.css4
3 files changed, 23 insertions, 7 deletions
diff --git a/README.md b/README.md
index b380692..874a365 100644
--- a/README.md
+++ b/README.md
@@ -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>&#187; <a href="{{.URL}}">{{ .Name }}</a> {{ .Post }}</li>
- {{end}}
- </ul>
+ {{ range .Site.Menus.main }}
+ <li>&#187; <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;
}