css changes

This commit is contained in:
0x01fe 2024-03-11 15:30:26 -05:00
parent 4e7429bd15
commit d22af9734e
5 changed files with 57 additions and 5 deletions

28
app/resources/status.text Normal file
View File

@ -0,0 +1,28 @@
Catchy Right?
Everybody's lazy when they're tired
As long as there is delusion, there is hope
It's 510.
Mindful of the weary inkling that is lurking
Mortal traffic lights signaling when to stay or go
Cyber surgeon, Javascript person
Bone-dried swamplands swallow me
House of dust, land of bone
I ate dirt, I drank stone
Come on, snake, punish me
Drip, drip from the tap, don't slip on the drip
His name really is Tim.
Just wait until you see the 1 in 1000 message.
I'm open to suggestions on how to improve the look of the website
Open the curtains
Don't miss a moment of this experiment
Needles
Sally forth Rocinante!
The multitude tightens its hold.
It's amazing what you'll find face to face
It's not hard to go the distance, When you finally get involved face to face
A tourist in a dream, A visitor, it seems, A half-forgotten song, Where do I belong?
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

View File

@ -100,12 +100,16 @@ a:hover {
border-radius: 10px;
padding: 10pt;
padding-left: 20pt;
padding-right: 20pt;
margin: 10pt;
margin-left: 20pt;
margin-right: 20pt;
background-color: #C9D6DF;
line-height: 1.25em;
}
.post p {

View File

@ -8,7 +8,7 @@
<body>
<div class="header">
<h1>0x01fe.net</h1>
<h4>Catchy Right‽</h4>
<h4>{{ status }}</h4>
</div>
<div class="container">
<!-- Sidebar -->

View File

@ -1,5 +1,6 @@
import glob
import configparser
import random
import flask
@ -7,12 +8,14 @@ from post import Post
app = flask.Flask(__name__, static_url_path='', static_folder='static')
CONFIG_PATH = "../config.ini"
config = configparser.ConfigParser()
config.read("config.ini")
config.read(CONFIG_PATH)
POSTS_FOLDER = config['POSTS']['POSTS_FOLDER']
STATUS_FILE = config['STATUS']['STATUS_FILE']
def get_posts() -> list[Post]:
def get_posts(category_filter : str | None = None) -> list[Post]:
post_files= glob.glob(f'{POSTS_FOLDER}/*')
post_files.remove(f'{POSTS_FOLDER}\\POST_TEMPLATE.md')
@ -20,7 +23,10 @@ def get_posts() -> list[Post]:
for post_file in post_files:
post = Post(post_file)
posts.append(post)
if not category_filter:
posts.append(post)
elif category_filter == post.category:
posts.append(post)
# Order Posts by Date
ordered_posts = []
@ -36,6 +42,14 @@ def get_posts() -> list[Post]:
return reversed(ordered_posts)
def get_status() -> str:
with open(STATUS_FILE, 'r') as file:
statuses = file.readlines()
status = random.randint(0, len(statuses) - 1)
return statuses[status]
@app.route('/')
def index():
@ -46,7 +60,10 @@ def index():
for post in posts:
post_bodies.append(post.body)
return flask.render_template('index.html', posts=post_bodies)
# Get status
status = get_status()
return flask.render_template('index.html', posts=post_bodies, status=status)
if __name__ == "__main__":

View File

@ -1,5 +1,8 @@
[POSTS]
posts_folder=./posts
[STATUS]
status_file=./resources/status.text
[NETWORK]
PORT=1111