Skip to content

Commit

Permalink
Turn getPages() into a .pages property
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun-menon committed Aug 6, 2024
1 parent 464a9f3 commit cf08515
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion alteza/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def isPwdGitRepo() -> bool:
except CalledProcessError:
return False

def getPages(self) -> Sequence["PageNode"]:
@property
def pages(self) -> Sequence["PageNode"]:
return [f for f in self.files if (isinstance(f, PageNode) and not f.isIndex())]

def getPyPagesOtherThanIndex(self) -> Iterator["PyPageNode"]:
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 @@ -17,7 +17,7 @@ <h4>
</h4>

<ul>
{% for file in dir.getPages() %}
{% for file in dir.pages %}
<li>
<a href="{{ linkObj(file) }}">
{{file.title}}
Expand Down

0 comments on commit cf08515

Please sign in to comment.