Merge branch 'bugfix/html_redirect_v4.4' into 'release/v4.4'

docs: fix html redirects not working (v4.4)

See merge request espressif/esp-idf!16284
pull/8102/head
Jiang Jiang Jian 2021-12-08 10:25:47 +00:00
commit b4a32e3812
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -171,3 +171,11 @@ languages = ['en', 'zh_CN']
google_analytics_id = os.environ.get('CI_GOOGLE_ANALYTICS_ID', None) google_analytics_id = os.environ.get('CI_GOOGLE_ANALYTICS_ID', None)
project_homepage = 'https://github.com/espressif/esp-idf' project_homepage = 'https://github.com/espressif/esp-idf'
# Custom added feature to allow redirecting old URLs
with open('../page_redirects.txt') as f:
lines = [re.sub(' +', ' ', line.strip()) for line in f.readlines() if line.strip() != '' and not line.startswith('#')]
for line in lines: # check for well-formed entries
if len(line.split(' ')) != 2:
raise RuntimeError('Invalid line in page_redirects.txt: %s' % line)
html_redirect_pages = [tuple(line.split(' ')) for line in lines]