Skip to content

Commit b90f52e

Browse files
committed
Fix #1: online link for main page
This adds a special case for online links which removes trailling /index from the URL.
1 parent 194aea5 commit b90f52e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

preprocess.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def preprocess_html_file(root, fn, rename_map):
223223

224224
link = etree.SubElement(etree.SubElement(items, 'li'), 'a')
225225
url = re.sub('(..)/(.*)\\.html', 'http://\\1.cppreference.com/w/\\2', os.path.relpath(fn, root))
226+
url = re.sub('(.*)/index', '\\1/', url)
226227
link.set('href', url)
227228
link.text = 'Online version'
228229

0 commit comments

Comments
 (0)