Commit cf25e9e8 authored by shadMod's avatar shadMod 💬

replaced for loop with GetNews().get_all_files_counter()

parent 8d3afb08
......@@ -20,6 +20,7 @@ import toml
import flask
from uitwww import cache
from .src.news.utils import GetNews
def get_pages_list(app, base=None, level=0):
......@@ -79,8 +80,8 @@ def prepare_blueprint(app):
data_path = os.path.expanduser(os.path.abspath("data"))
def list_news():
news_path = os.path.join(data_path, "news", "2023")
_list_news = [x.replace('.md', '') for x in os.listdir(news_path)[:4]]
nw_cl = GetNews(os.path.join(app.instance_path, "news"))
_list_news = nw_cl.get_all_files_counter(4)
return _list_news
def list_distro():
......
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