Skip to content

Commit c7c9800

Browse files
committed
Merge pull request GitbookIO#347 from rlmv/custom_links
Add custom links to TOC
2 parents 356322e + ddacbbe commit c7c9800

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ Here are the options that can be stored in this file:
9292
"issues": null,
9393
"contribute": null,
9494

95+
// Custom links at top of sidebar
96+
"custom": {
97+
"Custom link name": "https://customlink.com"
98+
},
99+
95100
// Sharing links
96101
"sharing": {
97102
"google": null,

theme/templates/includes/book/summary.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
</li>
6060
{% endif %}
6161

62+
{% if options.links.custom %}
63+
{% for link in options.links.custom %}
64+
{% set _divider = true %}
65+
<li>
66+
<a href="{{ options.links.custom[loop.key] }}" target="blank" class="custom-link">{{ loop.key }}</a>
67+
</li>
68+
{% endfor %}
69+
{% endif %}
70+
6271
{% if _divider %}
6372
<li class="divider"></li>
6473
{% endif %}

0 commit comments

Comments
 (0)