diff --git a/homepage/main.py b/homepage/main.py index f122040..e5488ba 100644 --- a/homepage/main.py +++ b/homepage/main.py @@ -14,19 +14,10 @@ import re # echo -n "["; ls | xargs -I{} echo -n \"{}\",; echo "]" BG_IMAGES = listdir("./static/img/background") -news = """ -=== 2021-03-24 === -* TestABC -* FooBar - -=== 2020-xx-xx === -* Map now available -""" - @route("/") def index(): players = currentPlayerData() - return template("html/index.html", **{"player_count": players["count"]["current"] , "max_players": players["count"]["max"], "news": news, "donations": donations()}) + return template("html/index.html", **{"player_count": players["count"]["current"] , "max_players": players["count"]["max"], "news": news(), "donations": donations()}) @route("/getPlayerSkins") def getPlayerSkins(): @@ -102,6 +93,10 @@ def donations(): donations = donation_file.read() return donations +def news(): + with open("news.txt", "r") as news_file: + news = news_file.read() + CONFIG = parseConfig() run(host="localhost", port=8080) diff --git a/homepage/news.txt b/homepage/news.txt new file mode 100644 index 0000000..9538d56 --- /dev/null +++ b/homepage/news.txt @@ -0,0 +1,6 @@ +=== 2021-03-24 === +* TestABC +* FooBar + +=== 2020-xx-xx === +* Map now available