Skip to content

Commit

Permalink
Change 2nd read parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
yaph committed Oct 9, 2020
1 parent 7d90988 commit 182982f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logya/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down

0 comments on commit 182982f

Please sign in to comment.