From 182982f5a26caac3a92a7fad254c9f2d1df25770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ramiro=20G=C3=B3mez?= Date: Fri, 9 Oct 2020 02:52:12 +0200 Subject: [PATCH] Change 2nd read parameter. --- logya/content.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logya/content.py b/logya/content.py index 86ee21c..285ad3f 100644 --- a/logya/content.py +++ b/logya/content.py @@ -111,7 +111,7 @@ def parse(content: str, content_type: str = None) -> dict: return parsed -def read(path: Path, paths) -> str: +def read(path: Path, path_rel: Path) -> str: content = path.read_text().strip() try: doc = parse(content, content_type=content_type(path)) @@ -123,7 +123,7 @@ def read(path: Path, paths) -> str: doc['title'] = doc.get('title', path.stem) # URLs set in the document are prioritized and left unchanged. - doc['url'] = doc.get('url', create_url(path.relative_to(paths.content))) + doc['url'] = doc.get('url', create_url(path_rel)) # Use file modification time for created and updated attributes if not set in document. modified = datetime.fromtimestamp(path.stat().st_mtime)