Add absolutize_link util
This commit is contained in:
parent
8820ce1b95
commit
ff7b03bc2b
|
@ -23,3 +23,10 @@ def read_links(f: TextIO) -> List[Link]:
|
||||||
reader = csv.reader(f)
|
reader = csv.reader(f)
|
||||||
next(reader) # Skip the header
|
next(reader) # Skip the header
|
||||||
return [Link(link[1], link[2]) for link in reader]
|
return [Link(link[1], link[2]) for link in reader]
|
||||||
|
|
||||||
|
|
||||||
|
def absolutize_link(link: str, page_base: str) -> str:
|
||||||
|
"""Ensure we have an absolute url."""
|
||||||
|
if link.startswith("./"):
|
||||||
|
link = page_base + link[2:]
|
||||||
|
return link
|
||||||
|
|
Loading…
Reference in a new issue