diff --git a/pppadump/commands/index.py b/pppadump/commands/index.py index 9c788a0..75cc267 100644 --- a/pppadump/commands/index.py +++ b/pppadump/commands/index.py @@ -294,14 +294,13 @@ def main (args): # Not sure this goes here but fixing relpaths with output is quite nice... if args.output: - outpath = Path(args.output).parent + outpath = str(Path(args.output).parent) for v in p["versions"]: if v["type"] != "pad": - vpath = Path(v["path"]) try: # 2 types (pathlib or os.path) # v["path"] = vpath.parent.relative_to(outpath).joinpath(vpath.name) - v["path"] = os.path.join(os.path.relpath(vpath.parent, outpath), vpath.name) + v["path"] = os.path.relpath(v["path"], outpath) # path or url??? if it's a file based publishing ethos, it should be path non? # puttting this here since templates are using url... @@ -310,9 +309,8 @@ def main (args): pass if not p["link"].startswith("http"): - vpath = Path(p["link"]) try: - p["link"] = os.path.join(os.path.relpath(vpath.parent, outpath), vpath.name) + p["link"] = os.path.relpath(p["link"], outpath) except Exception as e: pass