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 authored and schance995 committed May 7, 2022
1 parent 216a217 commit 6df0f4a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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,12 @@

downloader.download_images()

for lang_dir in next(os.walk(args.output_directory))[1]:
main_page = os.path.join(args.output_directory, lang_dir, 'Main_page.html')
index_html = os.path.join(args.output_directory, lang_dir, 'index.html')
if os.path.exists(main_page) and not os.path.islink(index_html):
print('Symlink', index_html, '->', main_page)
os.symlink('Main_page.html', index_html)

if args.clean:
downloader.clean_output_directory()

0 comments on commit 6df0f4a

Please sign in to comment.