From b2b48a91c868c6a12a98051893dabdb9462c0b0d Mon Sep 17 00:00:00 2001 From: Changkun Ou Date: Sun, 24 Jun 2018 12:22:20 +0200 Subject: [PATCH] see #5, fix *.md link error --- website/filter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/filter.py b/website/filter.py index 6b1be47..d2a5969 100644 --- a/website/filter.py +++ b/website/filter.py @@ -1,6 +1,7 @@ # !/usr/bin/env python3 # author: changkun import os +import re source_dir = [ '../book/zh-cn/' @@ -26,4 +27,4 @@ for index, source in enumerate(source_dir): if any(keyword in line for keyword in ignores): continue else: - output_file.write(line) + output_file.write(re.sub(r'(./)(.*?)(.md)', r'../\2/index.html', line))