various changes making the website look better
This commit is contained in:
parent
022f41a883
commit
8d49357074
@ -128,7 +128,8 @@ def index():
|
|||||||
comments = comment.get_comments(post.title)
|
comments = comment.get_comments(post.title)
|
||||||
posts_and_comments.append(({
|
posts_and_comments.append(({
|
||||||
"body" : post.body,
|
"body" : post.body,
|
||||||
"title" : post.title
|
"title" : post.title,
|
||||||
|
"date" : post.get_date()
|
||||||
},
|
},
|
||||||
comments))
|
comments))
|
||||||
|
|
||||||
|
|||||||
@ -25,5 +25,7 @@ class Post:
|
|||||||
date = lines[3].split(":")[1].strip()
|
date = lines[3].split(":")[1].strip()
|
||||||
self.date = datetime.datetime.strptime(date, "%d-%m-%Y")
|
self.date = datetime.datetime.strptime(date, "%d-%m-%Y")
|
||||||
|
|
||||||
self.body = markdown.markdown(f'# [{self.title}]({self.url})\n' + ''.join(lines[7:]))
|
self.body = markdown.markdown(f'# [{self.title}]({self.url})\n' + ''.join(lines[7:]), extensions=['footnotes'])
|
||||||
|
|
||||||
|
def get_date(self) -> str:
|
||||||
|
return self.date.strftime("%B %d, %Y")
|
||||||
|
|||||||
@ -4,6 +4,6 @@ author: author
|
|||||||
date: date
|
date: date
|
||||||
|
|
||||||
# POST
|
# POST
|
||||||
## TITLE
|
# TITLE
|
||||||
### DATE OR SUBTITLE
|
### DATE OR SUBTITLE
|
||||||
POST TEXT
|
POST TEXT
|
||||||
|
|||||||
@ -101,6 +101,7 @@ Buildings that you know // People come and go // Are a certain way
|
|||||||
And then you get the news that obliterates your view // Amputate your truths // The signifiance has changed
|
And then you get the news that obliterates your view // Amputate your truths // The signifiance has changed
|
||||||
Hospital inane // Meaningless and grey // But lie within the walls and the signifiance will change
|
Hospital inane // Meaningless and grey // But lie within the walls and the signifiance will change
|
||||||
What would it take for us to change the game? // Maybe our existence is signifiance in vain
|
What would it take for us to change the game? // Maybe our existence is signifiance in vain
|
||||||
|
Is that what we consider changing? // Ah, save me
|
||||||
|
|
||||||
# Candles by King Gizzard & The Lizard Wizard
|
# Candles by King Gizzard & The Lizard Wizard
|
||||||
This little man is too hot to handle // Set the funeral on fire with the candles
|
This little man is too hot to handle // Set the funeral on fire with the candles
|
||||||
|
|||||||
@ -19,6 +19,10 @@ html {
|
|||||||
--primary20: hsla(209, 61%, 71%, 20%);
|
--primary20: hsla(209, 61%, 71%, 20%);
|
||||||
--primary40: hsla(209, 61%, 71%, 40%);
|
--primary40: hsla(209, 61%, 71%, 40%);
|
||||||
--secondary: hsl(277, 81%, 33%);
|
--secondary: hsl(277, 81%, 33%);
|
||||||
|
--secondary10: hsla(277, 81%, 33%, 10%);
|
||||||
|
--secondary20: hsla(277, 81%, 33%, 20%);
|
||||||
|
--secondary30: hsla(277, 81%, 33%, 30%);
|
||||||
|
--secondary40: hsla(277, 81%, 33%, 40%);
|
||||||
--secondary50: hsla(277, 81%, 33%, 50%);
|
--secondary50: hsla(277, 81%, 33%, 50%);
|
||||||
--accent: hsl(291, 81%, 60%);
|
--accent: hsl(291, 81%, 60%);
|
||||||
--accent75: hsla(291, 81%, 60%, 75%);
|
--accent75: hsla(291, 81%, 60%, 75%);
|
||||||
@ -43,7 +47,24 @@ a:hover {
|
|||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
background-color: var(--secondary10);
|
||||||
|
border-style: var(--borders-style);
|
||||||
|
border-radius: 7.5px;
|
||||||
|
padding: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post blockquote p {
|
||||||
|
text-indent: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post blockquote li p {
|
||||||
|
text-indent: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-left: 4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Other */
|
/* Other */
|
||||||
@ -206,6 +227,10 @@ a:hover {
|
|||||||
text-indent: 3em;
|
text-indent: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.post-date {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
.comment-container {
|
.comment-container {
|
||||||
background-color: var(--primary40);
|
background-color: var(--primary40);
|
||||||
border-style: var(--borders-style);
|
border-style: var(--borders-style);
|
||||||
@ -215,6 +240,24 @@ a:hover {
|
|||||||
margin: 1em;
|
margin: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.comment {
|
||||||
|
background-color: var(--primary40);
|
||||||
|
border-style: var(--borders-style);
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
margin: 0.25em;
|
||||||
|
padding: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment h4 {
|
||||||
|
margin: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment p {
|
||||||
|
margin: 0.25em;
|
||||||
|
text-indent: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
.comment-editor textarea {
|
.comment-editor textarea {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
height: 6em;
|
height: 6em;
|
||||||
|
|||||||
@ -28,8 +28,12 @@
|
|||||||
<div class="dlog">
|
<div class="dlog">
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
|
<div class="post-date">
|
||||||
|
{{ post[0].date }}
|
||||||
|
</div>
|
||||||
{{ post[0].body|safe }}
|
{{ post[0].body|safe }}
|
||||||
<div class="comment-container">
|
<div class="comment-container">
|
||||||
|
<h2>Comments</h2>
|
||||||
{% for comment in post[1] %}
|
{% for comment in post[1] %}
|
||||||
<div class="comment">
|
<div class="comment">
|
||||||
<h4>{{ comment.username }}</h4>
|
<h4>{{ comment.username }}</h4>
|
||||||
@ -38,7 +42,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if user %}
|
{% if user %}
|
||||||
<div class="comment-editor">
|
<div class="comment-editor">
|
||||||
<h3>{{ user }}</h3>
|
<h4>{{ user }}</h4>
|
||||||
<form method="post" action="/comment/{{ post[0].title }}">
|
<form method="post" action="/comment/{{ post[0].title }}">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
{{ form.textbox }}
|
{{ form.textbox }}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ def add_user():
|
|||||||
|
|
||||||
# check if user exists
|
# check if user exists
|
||||||
if username in user_data:
|
if username in user_data:
|
||||||
flask.abort(400)
|
return 'ERROR PROCESSING REQUEST - That user already exists'
|
||||||
|
|
||||||
# Store password / server side cookie
|
# Store password / server side cookie
|
||||||
user_data[username] = base64.b64encode(password.encode()).decode()
|
user_data[username] = base64.b64encode(password.encode()).decode()
|
||||||
@ -71,11 +71,11 @@ def login_user():
|
|||||||
|
|
||||||
# check if user exists
|
# check if user exists
|
||||||
if username not in user_data:
|
if username not in user_data:
|
||||||
flask.abort(400)
|
return 'ERROR PROCESSING REQUEST - Bad username OR password'
|
||||||
|
|
||||||
# Does password match?
|
# Does password match?
|
||||||
if user_data[username] != password:
|
if user_data[username] != password:
|
||||||
flask.abort(400)
|
return 'ERROR PROCESSING REQUEST - Bad username OR password'
|
||||||
|
|
||||||
flask.session['username'] = username
|
flask.session['username'] = username
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user