css changes
This commit is contained in:
parent
4e7429bd15
commit
d22af9734e
28
app/resources/status.text
Normal file
28
app/resources/status.text
Normal 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
|
||||||
@ -100,12 +100,16 @@ a:hover {
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
||||||
padding: 10pt;
|
padding: 10pt;
|
||||||
|
padding-left: 20pt;
|
||||||
|
padding-right: 20pt;
|
||||||
|
|
||||||
margin: 10pt;
|
margin: 10pt;
|
||||||
margin-left: 20pt;
|
margin-left: 20pt;
|
||||||
margin-right: 20pt;
|
margin-right: 20pt;
|
||||||
|
|
||||||
background-color: #C9D6DF;
|
background-color: #C9D6DF;
|
||||||
|
|
||||||
|
line-height: 1.25em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post p {
|
.post p {
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1>0x01fe.net</h1>
|
<h1>0x01fe.net</h1>
|
||||||
<h4>Catchy Right‽</h4>
|
<h4>{{ status }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import glob
|
import glob
|
||||||
import configparser
|
import configparser
|
||||||
|
import random
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
|
|
||||||
@ -7,12 +8,14 @@ from post import Post
|
|||||||
|
|
||||||
app = flask.Flask(__name__, static_url_path='', static_folder='static')
|
app = flask.Flask(__name__, static_url_path='', static_folder='static')
|
||||||
|
|
||||||
|
CONFIG_PATH = "../config.ini"
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read("config.ini")
|
config.read(CONFIG_PATH)
|
||||||
|
|
||||||
POSTS_FOLDER = config['POSTS']['POSTS_FOLDER']
|
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= glob.glob(f'{POSTS_FOLDER}/*')
|
||||||
post_files.remove(f'{POSTS_FOLDER}\\POST_TEMPLATE.md')
|
post_files.remove(f'{POSTS_FOLDER}\\POST_TEMPLATE.md')
|
||||||
|
|
||||||
@ -20,7 +23,10 @@ def get_posts() -> list[Post]:
|
|||||||
for post_file in post_files:
|
for post_file in post_files:
|
||||||
post = Post(post_file)
|
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
|
# Order Posts by Date
|
||||||
ordered_posts = []
|
ordered_posts = []
|
||||||
@ -36,6 +42,14 @@ def get_posts() -> list[Post]:
|
|||||||
|
|
||||||
return reversed(ordered_posts)
|
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('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
|
|
||||||
@ -46,7 +60,10 @@ def index():
|
|||||||
for post in posts:
|
for post in posts:
|
||||||
post_bodies.append(post.body)
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
[POSTS]
|
[POSTS]
|
||||||
posts_folder=./posts
|
posts_folder=./posts
|
||||||
|
|
||||||
|
[STATUS]
|
||||||
|
status_file=./resources/status.text
|
||||||
|
|
||||||
[NETWORK]
|
[NETWORK]
|
||||||
PORT=1111
|
PORT=1111
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user