From 092759e4b1f8a73de5e4fef05b6c4372f239fe47 Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Wed, 13 Mar 2024 13:29:47 -0500 Subject: [PATCH] various rendering changes --- app/post.py | 2 +- app/resources/status.text | 5 ++++- app/static/index_style.css | 5 +++++ app/templates/index.html | 2 +- app/website.py | 5 +++-- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/post.py b/app/post.py index 16d54cf..c882e57 100644 --- a/app/post.py +++ b/app/post.py @@ -12,7 +12,7 @@ class Post: def __init__(self, file_path): self.file = file_path - with open(file_path, 'r') as file: + with open(file_path, 'r', encoding='utf-8') as file: lines = file.readlines() self.category = lines[1].split(":")[1].strip() diff --git a/app/resources/status.text b/app/resources/status.text index a00b8ec..07fe762 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -25,4 +25,7 @@ What do you mean ... You can't see it? I don't believe you, your eyes deceive you, better check yourself in You will say I'm crazy, I will go on my way 'cause it's what I need I'd cross a thousand seas just to prove I'm not mad -I thoguht I saw a statue blink, and a bird with no head, Land on a golden thread, I rub my eyes, What am I saying? There's nothing there \ No newline at end of file +I thoguht I saw a statue blink, and a bird with no head, Land on a golden thread, I rub my eyes, What am I saying? There's nothing there +Solar Sect of Mystic Wisdom +~ Nuclear Fusion +Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! \ No newline at end of file diff --git a/app/static/index_style.css b/app/static/index_style.css index ba2680c..8044fcd 100644 --- a/app/static/index_style.css +++ b/app/static/index_style.css @@ -38,6 +38,11 @@ a:hover { font-family: Arial, Helvetica, sans-serif; } +.header a { + text-decoration: none; + color: #703be7; +} + .container { display: flex; diff --git a/app/templates/index.html b/app/templates/index.html index e23ece6..6a3ce30 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -8,7 +8,7 @@

0x01fe.net

-

{{ status }}

+

{{ status|safe }}

diff --git a/app/website.py b/app/website.py index e0976ba..aba90f7 100644 --- a/app/website.py +++ b/app/website.py @@ -3,6 +3,7 @@ import configparser import random import flask +import markdown from post import Post @@ -43,12 +44,12 @@ def get_posts(category_filter : str | None = None) -> list[Post]: return reversed(ordered_posts) def get_status() -> str: - with open(STATUS_FILE, 'r') as file: + with open(STATUS_FILE, 'r', encoding='utf-8') as file: statuses = file.readlines() status = random.randint(0, len(statuses) - 1) - return statuses[status] + return markdown.markdown(statuses[status]) @app.route('/') def index():