diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-06-08 12:31:52 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-06-08 12:31:52 -0700 |
commit | b425db0979a878cd27a3327df9ea76ec9db5a8bb (patch) | |
tree | df97c8552b7b737940247b260c774de56b95daa9 /theme | |
parent | 30c6d1c9de45d5f92086131c505712fb67c833a9 (diff) | |
download | gitbook-b425db0979a878cd27a3327df9ea76ec9db5a8bb.zip gitbook-b425db0979a878cd27a3327df9ea76ec9db5a8bb.tar.gz gitbook-b425db0979a878cd27a3327df9ea76ec9db5a8bb.tar.bz2 |
Allow external links in summary, fixes #300
Diffstat (limited to 'theme')
-rw-r--r-- | theme/templates/includes/book/summary.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/theme/templates/includes/book/summary.html b/theme/templates/includes/book/summary.html index 697cce8..76ee192 100644 --- a/theme/templates/includes/book/summary.html +++ b/theme/templates/includes/book/summary.html @@ -1,10 +1,17 @@ {% macro articles(_articles) %} {% for item in _articles %} - <li class="chapter {% if item._path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path %}data-path="{{ item.path|mdLink }}"{% endif %}> + {% set externalLink = item.path|isExternalLink %} + <li class="chapter {% if item._path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path && !externalLink %}data-path="{{ item.path|mdLink }}"{% endif %}> {% if item.path %} - <a href="{{ basePath }}/{{ item.path|mdLink }}"> - <i class="fa fa-check"></i> <b>{{ item.level }}.</b> {{ item.title }} - </a> + {% if !externalLink %} + <a href="{{ basePath }}/{{ item.path|mdLink }}"> + <i class="fa fa-check"></i> <b>{{ item.level }}.</b> {{ item.title }} + </a> + {% else %} + <a target="_blank" href="{{ item.path }}"> + <i class="fa fa-check"></i> <b>{{ item.level }}.</b> {{ item.title }} + </a> + {% endif %} {% else %} <span><b>{{ item.level }}.</b> {{ item.title }}</span> {% endif %} |