Skip to content

Commit eeef317

Browse files
committed
If Table of Contents link is external, do not try to add base url to link
1 parent 3eacc60 commit eeef317

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data/layout.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mixin disqus(shortname)
1717
mixin menu(m, depth)
1818
li.menu-item(class=('-level-' + depth + (m.sections ? ' -parent' : '')))
1919
if m.url
20-
a.link.title(href=(base + m.url + (m.anchor || '')) class=((active === m.url && !m.anchor ? '-active' : '') + (' link-' + m.slug)))= m.title
20+
a.link.title(href=(((m.url.match(/^[a-z]+:\/\//) || m.url.match(/^mailto:/) || m.url.match(/^#/)) ? '' : base) + m.url + (m.anchor || '')) class=((active === m.url && !m.anchor ? '-active' : '') + (' link-' + m.slug)) )= m.title
2121
else if m.title
2222
span.title= m.title
2323

0 commit comments

Comments
 (0)