main
Anish Lakhwara 2022-07-11 13:35:57 +10:00
parent 259a514ce9
commit 9c4e0510b0
1 changed files with 4 additions and 5 deletions

View File

@ -135,7 +135,7 @@ def generate_html_pages(site_folder, entries, template, sub_pages_list, template
# Checking if content folder exists # Checking if content folder exists
folderExists = os.path.exists(site_folder + entry['folder']) folderExists = os.path.exists(site_folder + entry['folder'])
# If not, create it # If not, create it
if config.flat_build == False: if config.flat_build:
if not folderExists: if not folderExists:
os.mkdir(site_folder + entry['folder']) os.mkdir(site_folder + entry['folder'])
@ -162,7 +162,7 @@ def get_entry_title(page):
# remove .wiki from the end of the file name # remove .wiki from the end of the file name
textContent = page.split('/')[1][:-5] textContent = page.split('/')[1][:-5]
except FileNotFoundError: except FileNotFoundError:
#print(f"Page not found, but present in tags: {page}") # print(f"Page not found, but present in tags: {page}")
return None return None
except UnicodeDecodeError: except UnicodeDecodeError:
print(f"Page could not be read: {page}") print(f"Page could not be read: {page}")
@ -192,9 +192,8 @@ def style_iframes(page):
page = page.replace(match, iframe) page = page.replace(match, iframe)
return page return page
# Get a list of the tags in the page # Get a list of the tags in the page
def get_tags(page): def get_tags(page):
regex = r":[a-zA-Z:]*:" regex = r":[a-zA-Z:]*:"
matches = re.finditer(regex, page, re.MULTILINE) matches = re.finditer(regex, page, re.MULTILINE)
@ -471,7 +470,7 @@ def clean_path(path):
path_items["iso_date"] = str(last_edit_iso) path_items["iso_date"] = str(last_edit_iso)
if config.flat_build == False: if config.flat_build:
path_items["slug"] = path_items["folder"] + "/" + path_items["slug"] path_items["slug"] = path_items["folder"] + "/" + path_items["slug"]
# TODO weird special case # TODO weird special case