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
fixes #2
  • Loading branch information
kiasoc5 committed May 8, 2022
1 parent 216a217 commit 203ca44
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 @@ -2,6 +2,7 @@

import datetime
import argparse
import os

from simplemediawiki import build_user_agent

Expand Down Expand Up @@ -33,5 +34,16 @@

downloader.download_images()

for f in os.listdir(args.output_directory):
lang_dir = join(args.output_directory, f)
if os.path.isdir(lang_dir):
main_page = join(lang_dir, 'Main_page.html')
index_html = 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 203ca44

Please sign in to comment.