Skip to content

Commit

Permalink
Add absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
romw314 authored and jayanta525 committed Oct 22, 2024
1 parent 03a0276 commit 23aaca5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ def get_template_head(foldername):
"""
get template head
"""

# remove the dot (.) at the beginning of foldername
if foldername.startswith('.'):
if not foldername.startswith('/', 1):
return get_template_head('/' + foldername[1:])
else:
return get_template_head(foldername[1:])

with open("/src/template/head.html", "r", encoding="utf-8") as file:
head = file.read()
head = head.replace("{{foldername}}", foldername)
Expand Down

0 comments on commit 23aaca5

Please sign in to comment.