Fix up index suffixes

This commit is contained in:
Tom Christie 2012-09-05 18:25:30 +01:00
parent 367dd01a33
commit 077f7fef9b

View File

@ -65,5 +65,5 @@ for (dirpath, dirnames, filenames) in os.walk(docs_dir):
if not os.path.exists(build_dir):
os.makedirs(build_dir)
output = page.replace('{{ content }}', content).replace('{{ toc }}', toc).replace('{{ base_url }}', base_url).replace('{{ suffix }}', suffix).replace('{{ index }}', index)
output = re.sub(r'a href="([^"]*)\.md"', r'a href="\1.html"', output)
output = re.sub(r'a href="([^"]*)\.md"', r'a href="\1%s"' % suffix, output)
open(build_file, 'w').write(output.encode('utf-8'))