summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-07-11 17:15:37 -0700
committerSamy Pessé <samypesse@gmail.com>2014-07-11 17:15:37 -0700
commitc7c98009e70865dddaeb548097248e14c275a98c (patch)
tree36dcf0159225be99508841756f67d168b9cb8f58
parent356322e0ed8cfb1fc1547ee27d7143d5b2e22c22 (diff)
parentddacbbe73bb3b8a3717c4ea589b5b19514104e8c (diff)
downloadgitbook-c7c98009e70865dddaeb548097248e14c275a98c.zip
gitbook-c7c98009e70865dddaeb548097248e14c275a98c.tar.gz
gitbook-c7c98009e70865dddaeb548097248e14c275a98c.tar.bz2
Merge pull request #347 from rlmv/custom_links
Add custom links to TOC
-rw-r--r--README.md5
-rw-r--r--theme/templates/includes/book/summary.html9
2 files changed, 14 insertions, 0 deletions
diff --git a/README.md b/README.md
index 8c15303..f7cecc5 100644
--- a/README.md
+++ b/README.md
@@ -92,6 +92,11 @@ Here are the options that can be stored in this file:
"issues": null,
"contribute": null,
+ // Custom links at top of sidebar
+ "custom": {
+ "Custom link name": "https://customlink.com"
+ },
+
// Sharing links
"sharing": {
"google": null,
diff --git a/theme/templates/includes/book/summary.html b/theme/templates/includes/book/summary.html
index 8dfdb70..8014d7e 100644
--- a/theme/templates/includes/book/summary.html
+++ b/theme/templates/includes/book/summary.html
@@ -59,6 +59,15 @@
</li>
{% endif %}
+ {% if options.links.custom %}
+ {% for link in options.links.custom %}
+ {% set _divider = true %}
+ <li>
+ <a href="{{ options.links.custom[loop.key] }}" target="blank" class="custom-link">{{ loop.key }}</a>
+ </li>
+ {% endfor %}
+ {% endif %}
+
{% if _divider %}
<li class="divider"></li>
{% endif %}