Compare commits

..

No commits in common. "39d34bf51c2c22763bab11f044a6701abbb15787" and "a6bab311c6e656e25409a32ccf156fda2f02ba1e" have entirely different histories.

12 changed files with 125 additions and 217 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
data data
data.db data.db
indexdir indexdir
*.bak

View File

@ -6,11 +6,11 @@ COPY src /blog
WORKDIR /blog WORKDIR /blog
RUN pip3 install -r requirements.txt
VOLUME /blog/data VOLUME /blog/data
VOLUME /blog/static/graphics RUN pip3 install -r requirements.txt
VOLUME /blog/templates/entry
EXPOSE 5000 EXPOSE 5000

View File

@ -17,7 +17,6 @@ The blog is intended to be used to review and critique things.
- [x] Writing entries - [x] Writing entries
- [ ] Editing entries - [ ] Editing entries
- [x] Deleting entries - [x] Deleting entries
- [ ] Better interface for writing, editing, deleting, login
- [x] Infinite-scroll blog page - [x] Infinite-scroll blog page
- [x] Archive page - [x] Archive page
- [x] Months as headings - [x] Months as headings
@ -26,7 +25,7 @@ The blog is intended to be used to review and critique things.
- [x] Standalone article page - [x] Standalone article page
- [x] Links to scrolling blog page - [x] Links to scrolling blog page
- [x] Search page - [x] Search page
- [x] Full-text search - Full-text search
- [x] RSS feed - [x] RSS feed
- [x] Eye candy - [x] Eye candy
- [x] Star rating - [x] Star rating

View File

@ -4,8 +4,7 @@ docker rm container-critique
docker build . -t tiyn/container-critique docker build . -t tiyn/container-critique
docker run --name container-critique \ docker run --name container-critique \
--restart unless-stopped \ --restart unless-stopped \
-p "5001:5000" \ -p "5000:5000" \
-e FLASK_ENV=development \ -e FLASK_ENV=development \
-v data:/blog/data \ -v data:/blog/data
-v graphics:/blog/static/graphics \
-d tiyn/container-critique -d tiyn/container-critique

View File

@ -1,8 +1,8 @@
from datetime import date from datetime import date
from flask_ckeditor import CKEditorField from flask_ckeditor import CKEditorField
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, StringField from wtforms import StringField, PasswordField, SubmitField, TextField
from wtforms.fields import IntegerField from wtforms.fields.html5 import IntegerField
from wtforms.validators import DataRequired, EqualTo, InputRequired, \ from wtforms.validators import DataRequired, EqualTo, InputRequired, \
NumberRange, ValidationError, Length NumberRange, ValidationError, Length
@ -35,7 +35,7 @@ class SearchForm(FlaskForm):
""" """
A Class for the Form that is used while searching. A Class for the Form that is used while searching.
""" """
query_str = StringField( query_str = TextField(
"Query", [DataRequired("Please enter the search term")]) "Query", [DataRequired("Please enter the search term")])
submit = SubmitField("Search") submit = SubmitField("Search")

View File

@ -1,7 +1,7 @@
Flask Flask==2.1.3
Flask_CKEditor Flask_CKEditor==0.4.6
Flask_Login Flask_Login==0.6.2
Flask_WTF Flask_WTF==0.14.3
Werkzeug Werkzeug==2.0.0
Whoosh Whoosh==2.7.4
WTForms WTForms==2.2.1

View File

@ -2,71 +2,14 @@
:root { :root {
--bg0: rgb(29,32,33); --bg0: rgb(29,32,33);
--bg1: rgb(50,55,60);
--color0: rgb(220,120,0); --color0: rgb(220,120,0);
--error: rgb(255,0,0); --footerbg0: rgb(50,55,60);
--footerbg0: rgb(29,32,33);
--link0: rgb(220, 120, 0); --link0: rgb(220, 120, 0);
--link1: rgb(255,255,255); --link1: rgb(255,255,255);
--menulink0: rgb(220, 120, 0); --menulink0: rgb(220, 120, 0);
--menulink1: rgb(255,255,255); --menulink1: rgb(255,255,255);
--menubg0: rgb(29,32,33); --menubg0: rgb(50,55,60);
--text0: rgb(235,219,178); --text0: rgb(235,219,178);
--text1: rgb(220, 120, 0); --text1: rgb(220, 120, 0);
} }
a {
color: var(--link0);
transition: var(--transtime);
}
a:hover {
color: var(--link1);
}
body {
background: var(--bg0);
}
footer {
background: var(--footerbg0);
color: var(--text0);
}
span {
color: var(--text1);
}
.container {
color: var(--text0);
}
.container h1,
.container h2 {
color: var(--text1);
}
.container .flash {
background-color: var(--error);
}
.hide-menu:hover,
.main-menu a:hover,
.show-menu:hover {
color: var(--menulink1);
}
.main-menu a {
color: var(--menulink0);
}
.main-menu-dropdown {
background: var(--menubg0);
color: var(--menulink0);
}
@media screen and (max-width:800px) {
.main-menu {
background: var(--menubg0);
}
}

View File

@ -2,71 +2,14 @@
:root { :root {
--bg0: rgb(255,255,255); --bg0: rgb(255,255,255);
--bg1: rgb(192,192,192);
--color0: rgb(0,0,120); --color0: rgb(0,0,120);
--error: rgb(255,0,0);
--footerbg0: rgb(192,192,192); --footerbg0: rgb(192,192,192);
--link0: rgb(0,0,120); --link0: rgb(0,0,120);
--link1: rgb(0,0,0); --link1: rgb(255,255,255);
--menulink0: rgb(0,0,120); --menulink0: rgb(0,0,120);
--menulink1: rgb(255,255,255); --menulink1: rgb(255,255,255);
--menubg0: rgb(192,192,192); --menubg0: rgb(192,192,192);
--text0: rgb(0,0,0); --text0: rgb(0,0,0);
--text1: rgb(0,0,120); --text1: rgb(0,0,120);
} }
a {
color: var(--link0);
transition: var(--transtime);
}
a:hover {
color: var(--link1);
}
body {
background: var(--bg0);
}
footer {
background: var(--footerbg0);
color: var(--text0);
}
span {
color: var(--text1);
}
.container {
color: var(--text0);
}
.container h1,
.container h2 {
color: var(--text1);
}
.container .flash {
background-color: var(--error);
}
.hide-menu:hover,
.main-menu a:hover,
.show-menu:hover {
color: var(--menulink1);
}
.main-menu a {
color: var(--menulink0);
}
.main-menu-dropdown {
background: var(--menubg0);
color: var(--menulink0);
}
@media screen and (max-width:800px) {
.main-menu {
background: var(--menubg0);
}
}

View File

@ -3,27 +3,56 @@
--transtime: 0.7s; --transtime: 0.7s;
} }
@font-face{
font-family: "LocalMono";
src: url("/static/fonts/jetbrainsmono-medium.woff2") format("woff2");
}
@font-face {
font-family: "LocalSans";
font-style: normal;
font-weight: 400;
src: url("/static/fonts/linux_libertine.woff2") format("woff2");
}
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
a { a {
color: var(--link0);
text-decoration: none; text-decoration: none;
transition: var(--transtime); transition: var(--transtime);
} }
a:hover { a:hover {
color: var(--link1);
cursor: pointer; cursor: pointer;
} }
.main-menu a {
color: var(--menulink0);
padding: 0 10px;
text-decoration: none;
text-transform: uppercase;
transition: 0.7s;
}
.main-menu a:hover {
color: var(--menulink1);
}
body { body {
background: var(--bg0);
margin: 0; margin: 0;
} }
body, body,
html { html {
font-family: sans-serif; font-family: LocalSans, sans-serif;
height: 100%; height: 100%;
max-width: 100%; max-width: 100%;
overflow-x: hidden; overflow-x: hidden;
@ -37,11 +66,54 @@ footer {
text-align: center; text-align: center;
} }
footer .center { .container h1,
text-align: center; .container h2 {
color: var(--text1);
} }
.entry h1,
.entry h2 {
color: var(--text1);
margin: 5px auto 2px auto;
}
li:not(:last-child) {
margin-bottom: 5px;
}
ol {
margin: 10px 0;
padding-left: 20;
}
ul {
margin: 10px 0;
padding-left: 20;
}
span {
color: var(--text1);
}
.main-menu-dropdown span {
float: left;
font-family: LocalMono, monospace;
font-size: 30px;
font-weight: bold;
line-height: 100px;
padding: 0 10px;
text-decoration: none;
text-transform: uppercase;
transition: 0.7s;
}
.important span {
font-weight: bold;
}
.container { .container {
color: var(--text0);
min-height: 100%; min-height: 100%;
padding-bottom: 50px; padding-bottom: 50px;
padding-left: 10%; padding-left: 10%;
@ -50,10 +122,20 @@ footer .center {
} }
.container .flash { .container .flash {
background-color: var(--error);
padding: 10px; padding: 10px;
width: 400px; width: 400px;
} }
.entry {
background: var(--bg1);
border-left: 10px solid var(--color0);
border-radius: 0 10px 30px 0;
color: var(--text0);
margin-bottom: 20px;
padding: 10px;
}
.hide-menu, .hide-menu,
.show-menu { .show-menu {
cursor: pointer; cursor: pointer;
@ -62,6 +144,13 @@ footer .center {
transition: var(--transtime); transition: var(--transtime);
} }
.hide-menu:hover,
.show-menu:hover {
color: var(--menulink1);
}
.important { .important {
font-size: xx-large; font-size: xx-large;
padding-left: 25vw; padding-left: 25vw;
@ -70,47 +159,22 @@ footer .center {
text-align: left; text-align: left;
} }
.important span {
font-weight: bold;
}
.logo { .logo {
height: 80px; height: 80px;
padding-top: 10px; padding-top: 10px;
} }
.main-menu-dropdown img {
float: left;
}
.main-menu-dropdown span {
float: left;
font-family: monospace;
font-size: 30px;
font-weight: bold;
line-height: 100px;
padding: 0 10px;
text-decoration: none;
text-transform: uppercase;
transition: 0.7s;
}
.main-menu { .main-menu {
float: right; float: right;
font-family: monospace; font-family: LocalMono, monospace;
font-size: 30px; font-size: 30px;
font-weight: bold; font-weight: bold;
line-height: 100px; line-height: 100px;
} }
.main-menu a {
padding: 0 10px;
text-decoration: none;
text-transform: uppercase;
transition: 0.7s;
}
.main-menu-dropdown { .main-menu-dropdown {
background: var(--menubg0);
color: var(--menulink0);
height: 100px; height: 100px;
padding: 0 20px; padding: 0 20px;
} }
@ -127,6 +191,11 @@ footer .center {
} }
@media screen and (max-width:800px) { @media screen and (max-width:800px) {
.main-menu a {
display: block;
padding: 20px;
}
.hide-menu { .hide-menu {
position: absolute; position: absolute;
right: 40px; right: 40px;
@ -139,6 +208,7 @@ footer .center {
} }
.main-menu { .main-menu {
background: var(--menubg0);
height: 100vh; height: 100vh;
line-height: normal; line-height: normal;
padding: 80px 0; padding: 80px 0;
@ -149,49 +219,8 @@ footer .center {
transition: var(--transtime); transition: var(--transtime);
width: 100%; width: 100%;
} }
.main-menu a {
display: block;
padding: 20px;
}
#main-menu-check:checked ~ .main-menu { #main-menu-check:checked ~ .main-menu {
right: 0; right: 0;
} }
} }
.entry {
border-radius: 0 10px 30px 0;
margin-bottom: 20px;
padding: 10px;
}
.entry h1,
.entry h2 {
margin: 5px auto 2px auto;
}
.entry ul {
padding-left: 20;
}
figure {
padding:20px;
}
ul {
padding-left:20px;
}
ol {
padding-left:20px;
}
code {
border-radius: 25px;
padding-left: 20px;
padding-right: 20px;
page-break-inside: avoid;
font-family: monospace;
white-space: pre;
display: inline-block
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

View File

@ -13,14 +13,14 @@
{{ entry.user.name }} {{ entry.user.name }}
</a> </a>
on on
<a href="{{ url_for('index', _anchor='{0:d}'.format(entry.id)) }}"> <a href="{{ url_for('index', _anchor=entry.id) }}">
{{ entry.date }} {{ entry.date }}
</a> </a>
</small><br> </small><br>
{% if current_user.id == entry.user.id -%} {% if current_user.id == entry.user.id -%}
<small> <small>
[ [
<a href="{{ url_for('delete_entry', ident='{0:d}'.format(entry.id)) }}"> <a href="{{ url_for('delete_entry', ident=entry.id) }}">
delete entry delete entry
</a> </a>
] ]

View File

@ -10,16 +10,12 @@
<title>{{ title }}</title> <title>{{ title }}</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width" initial-scale=1.0> <meta name="viewport" content="width=device-width" initial-scale=1.0>
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='graphics/logo.png') }}">
<link href="{{ url_for('static', filename='css/' + style + '.css') }}" rel="stylesheet" type="text/css"> <link href="{{ url_for('static', filename='css/' + style + '.css') }}" rel="stylesheet" type="text/css">
</head> </head>
<body> <body>
<div class="main-menu-dropdown"> <div class="main-menu-dropdown">
<!-- <img class="logo" src="/static/images/logo.png"> --> <!-- <img class="logo" src="/static/images/logo.png"> -->
<a href="{{ url_for('index') }}">
<img class="logo" src="{{ url_for('static', filename='graphics/logo.png') }}">
<span>{{ title }}</span> <span>{{ title }}</span>
</a>
<input type="checkbox" id="main-menu-check"> <input type="checkbox" id="main-menu-check">
<label for="main-menu-check" class="show-menu">&#9776;</label> <label for="main-menu-check" class="show-menu">&#9776;</label>
<div class="main-menu"> <div class="main-menu">