relpath out and indexed
This commit is contained in:
parent
33a12cca03
commit
0fa929af41
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user