Skip to content

Commit

Permalink
Turn getTitle() into a .title property
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun-menon committed Aug 6, 2024
1 parent 1f922aa commit 464a9f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion alteza/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def getLinkName(self) -> str:
return self.getParentDir().getRectifiedName()
return self.realName

def getTitle(self) -> str:
@property
def title(self) -> str:
if "title" in self.env:
return self.env["title"]
return self.realName
Expand Down
2 changes: 1 addition & 1 deletion test_content/sectionK/sectionL/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Welcome to Section L
{{
for file in dir.files:
write('<li><a href="%s">%s</a> <code>%s</code> </li>' %
(linkObj(file), file.getTitle(), ' -> ' + file.fullPath))
(linkObj(file), file.title, ' -> ' + file.fullPath))
}}
</ol>

Expand Down
2 changes: 1 addition & 1 deletion test_content/sectionK/sectionM/index.py.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h4>
{% for file in dir.getPages() %}
<li>
<a href="{{ linkObj(file) }}">
{{file.getTitle()}}
{{file.title}}
</a>
</li>
{% endfor %}
Expand Down

0 comments on commit 464a9f3

Please sign in to comment.