TODO category filter page generation, link LeetCode tag page for now

This commit is contained in:
2023-10-08 20:07:25 -05:00
parent 28196dcdec
commit d28977dfa0
3 changed files with 28 additions and 18 deletions

View File

@@ -91,7 +91,10 @@ def main():
f"[{question.title}]({question.url})",
solutions,
question.difficulty,
", ".join(f"[{tag.name}](/categories/{tag.slug.upper()}.md)" for tag in question.tags),
", ".join(
# TODO: Generate category pages as a "filter" page for the README.md file.
# {/categories/tag.slug.upper()}.md
f"[{tag.name}]({tag.url})" for tag in question.tags),
]
row = "| " + " | ".join(map(str, columns)) + " |"

View File

@@ -27,6 +27,13 @@ class Tag(BaseModel):
slug: str
name: str
@property
def url(self) -> str:
"""
Gets the URL to the tag.
"""
return f"https://leetcode.com/tag/{self.slug}"
class Question(BaseModel):
"""