Skip to content

Commit

Permalink
Create index.html as symlink to Main_page.html
Browse files Browse the repository at this point in the history
  • Loading branch information
kiasoc5 committed May 10, 2022
1 parent ad8bd59 commit e83f5fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arch-wiki-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import datetime
import argparse
import sys
import os

from simplemediawiki import build_user_agent

Expand Down Expand Up @@ -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()

0 comments on commit e83f5fb

Please sign in to comment.