Commit 439dbf11 authored by shadMod's avatar shadMod 💬

added category in detail()

parent 42024978
...@@ -52,11 +52,12 @@ class News: ...@@ -52,11 +52,12 @@ class News:
list_years=nw_cl.list_year_month list_years=nw_cl.list_year_month
) )
@bp.route("/<year>/<filename>") @bp.route("/<year>/<category>/<filename>")
def detail(year: int, filename: str): @cache.enable
def detail(year: str, category: str, filename: str):
return flask.render_template( return flask.render_template(
"news/detail.html", "news/detail.html",
news=nw_cl.get_data(f"{filename}.md", year) news=nw_cl.get_news(nr_file=filename, year=year, category=category)
) )
return bp return bp
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment