use relative paths in build
This commit is contained in:
parent
2ee7b67ab5
commit
49f398ea40
9
build.py
9
build.py
|
@ -16,8 +16,8 @@ def main():
|
||||||
parser.add_argument("out", help="output directory", nargs="?", default="./out")
|
parser.add_argument("out", help="output directory", nargs="?", default="./out")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
src = pathlib.Path(args.src).absolute()
|
src = pathlib.Path(args.src)
|
||||||
out = pathlib.Path(args.out).absolute()
|
out = pathlib.Path(args.out)
|
||||||
|
|
||||||
md = markdown.Markdown(extensions=["attr_list", "footnotes", "meta"])
|
md = markdown.Markdown(extensions=["attr_list", "footnotes", "meta"])
|
||||||
|
|
||||||
|
@ -31,10 +31,9 @@ def main():
|
||||||
(src / ".template.html").read_text(encoding="utf8"),
|
(src / ".template.html").read_text(encoding="utf8"),
|
||||||
features="html.parser")
|
features="html.parser")
|
||||||
|
|
||||||
# cd to src so os.walk(.) returns paths relative to src
|
|
||||||
os.chdir(src)
|
|
||||||
count = 0
|
count = 0
|
||||||
for dirpath, dirnames, filenames in os.walk("."):
|
for dirpath, _, filenames in os.walk(src):
|
||||||
|
dirpath = pathlib.Path(dirpath).relative_to(src)
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
if filename[0] == ".":
|
if filename[0] == ".":
|
||||||
continue # Skip dotfiles
|
continue # Skip dotfiles
|
||||||
|
|
Loading…
Reference in New Issue