diff --git a/arch-wiki-docs.py b/arch-wiki-docs.py index 2903f46..b05c414 100755 --- a/arch-wiki-docs.py +++ b/arch-wiki-docs.py @@ -3,6 +3,7 @@ import datetime import argparse import sys +import os from simplemediawiki import build_user_agent @@ -42,5 +43,16 @@ downloader.download_images() + for f in os.listdir(args.output_directory): + lang_dir = os.path.join(args.output_directory, f) + if os.path.isdir(lang_dir): + main_page = os.path.join(lang_dir, "Main_page.html") + index_html = os.path.join(lang_dir, "index.html") + if os.path.exists(main_page) and not os.path.exists(index_html): + print("Symlink", index_html, "->", main_page) + os.symlink("Main_page.html", index_html) + else: + print(main_page, "exists, skipping") + if args.clean: downloader.clean_output_directory()