Skip to content

Commit

Permalink
Fixed lowercase bug in netlify server
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Yuen authored and Peter Yuen committed Apr 13, 2022
1 parent 5a22b81 commit 7809c68
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
def slugify_path(path: Union[str, Path]) -> Path:
"""Slugifies every component of a path. Note that '../xxx' will get slugified to '/xxx'. Always use absolute paths."""

path = Path(path)
path = Path(str(path).lower())
if Settings.is_true("SLUGIFY"):
os_path = "/".join(slugify(item) for item in str(path.parent).split("/"))
name = ".".join(slugify(item) for item in path.stem.split("."))
Expand Down Expand Up @@ -103,8 +103,7 @@ def abs_url(self, doc_path: "DocPath") -> str:
.resolve()
.relative_to(docs_dir)
)
if doc_path.slugified:
new_rel_path = slugify_path(new_rel_path)
new_rel_path = slugify_path(new_rel_path)
return f"/docs/{new_rel_path}"

@classmethod
Expand Down Expand Up @@ -133,12 +132,8 @@ def __init__(self, path: Path, slugify: bool):
"""Path parsing."""
self.old_path = path.resolve()
self.old_rel_path = self.old_path.relative_to(raw_dir)
if slugify:
self.new_rel_path = slugify_path(self.old_rel_path)
else:
self.new_rel_path = self.old_rel_path
self.new_rel_path = slugify_path(self.old_rel_path)
self.new_path = docs_dir / str(self.new_rel_path)
self.slugified = slugify

# --------------------------------- Sections --------------------------------- #

Expand Down

0 comments on commit 7809c68

Please sign in to comment.