Skip to content

Commit a6efcb8

Browse files
Merge pull request #29 from JasperVanDenBosch/orphaned-child-pages
create directories for skipped parents
2 parents 9e06b5f + f239335 commit a6efcb8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "syrinx"
7-
version = "0.0.10"
7+
version = "0.0.11"
88
authors = [
99
{ name="Jasper van den Bosch"},
1010
]

syrinx/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import annotations
2-
from typing import TYPE_CHECKING, Callable, Optional
2+
from typing import TYPE_CHECKING, Callable
33
from os.path import isdir, join, isfile
44
import shutil, os
55
from jinja2 import Environment, FileSystemLoader, select_autoescape
@@ -38,11 +38,11 @@ def build_node(
3838
"""Recursive function to render page, then move on to children
3939
"""
4040
node_path = join(parent_path, node.name)
41+
os.makedirs(node_path, exist_ok=True)
4142
if node.buildPage:
4243
fname_tem = choose_template_file(node, isfile, template_dir)
4344
page_template = env.get_template(fname_tem)
4445
html = page_template.render(index=node, root=root)
45-
os.makedirs(node_path, exist_ok=True)
4646
out_fpath = join(node_path, 'index.html')
4747
with open(out_fpath, 'w') as fhandle:
4848
fhandle.write(html)

0 commit comments

Comments
 (0)