Merge branch 'python+markdown' of https://github.com/0x01FE/My-Website into python+markdown
This commit is contained in:
commit
0798b5b37a
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,3 +2,6 @@ __pycache__
|
||||
*.md
|
||||
!POST_TEMPLATE.md
|
||||
!README.md
|
||||
|
||||
docker-compose.yaml
|
||||
*.sh
|
||||
@ -15,4 +15,4 @@ RUN python3 -m pip install -r requirements.txt
|
||||
|
||||
WORKDIR ./app
|
||||
|
||||
CMD ["python3", "-u", "./app.py"]
|
||||
CMD ["python3", "-u", "app.py"]
|
||||
|
||||
12
app/app.py
12
app/app.py
@ -3,6 +3,7 @@ import configparser
|
||||
import random
|
||||
|
||||
import flask
|
||||
import waitress
|
||||
import markdown
|
||||
|
||||
from post import Post
|
||||
@ -15,10 +16,12 @@ config.read(CONFIG_PATH)
|
||||
|
||||
POSTS_FOLDER = config['POSTS']['POSTS_FOLDER']
|
||||
STATUS_FILE = config['STATUS']['STATUS_FILE']
|
||||
PORT = int(config['NETWORK']['PORT'])
|
||||
DEV = int(config['NETWORK']['DEV'])
|
||||
|
||||
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')
|
||||
post_files = glob.glob(f'{POSTS_FOLDER}/*')
|
||||
post_files.remove(f'{POSTS_FOLDER}/POST_TEMPLATE.md')
|
||||
|
||||
posts: list[Post] = []
|
||||
for post_file in post_files:
|
||||
@ -68,4 +71,7 @@ def index():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
if DEV:
|
||||
app.run(port=PORT)
|
||||
else:
|
||||
waitress.serve(app, host='0.0.0.0', port=PORT)
|
||||
|
||||
@ -25,7 +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
|
||||
I thought 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)!
|
||||
@ -1,8 +1,9 @@
|
||||
[POSTS]
|
||||
posts_folder=./posts
|
||||
posts_folder=posts
|
||||
|
||||
[STATUS]
|
||||
status_file=./resources/status.text
|
||||
status_file=resources/status.text
|
||||
|
||||
[NETWORK]
|
||||
DEV=0
|
||||
PORT=1111
|
||||
|
||||
@ -1,2 +1,4 @@
|
||||
Markdown==3.5.2
|
||||
Flask==2.2.3
|
||||
Flask==2.2.3
|
||||
waitress==2.1.2
|
||||
Werkzeug==2.2.3
|
||||
Loading…
x
Reference in New Issue
Block a user