aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--static/main.css91
-rw-r--r--templates/base.html6
-rw-r--r--templates/index.html2
-rw-r--r--templates/site/home.html2
-rw-r--r--views.py13
5 files changed, 62 insertions, 52 deletions
diff --git a/static/main.css b/static/main.css
index 4db48f9..a0be844 100644
--- a/static/main.css
+++ b/static/main.css
@@ -1,13 +1,16 @@
-h1,h2,h3,h4 {
+h1 {
text-align: center;
- margin: 0.25em auto;
+ margin: 1% auto;
white-space: normal;
}
-h3,h4 {
- text-align: justify;
- margin: 0.25em auto;
+h2,h3,h4 {
+ text-align: left;
+ margin: 1% auto;
+ white-space: normal;
+}
+h2.center {
+ text-align: center;
}
-/* class to optionally center h3 when we want it */
h3.center {
text-align: center;
}
@@ -17,15 +20,15 @@ h1 {
}
h2 {
font-size: 175%;
- color: #404040;
+ color: #202020;
}
h3 {
font-size: 150%;
- color: #808080;
+ color: #404040;
}
h4 {
font-size: 125%;
- color: #bfbfbf;
+ color: #808080;
}
body {
margin: 0 auto;
@@ -35,27 +38,6 @@ body {
white-space: normal;
font-size: 120%;
}
-
-.navbar {
- text-align: center;
- max-width: 95%;
- display: block;
-}
-.content {
- text-align: justify;
- max-width: 85%;
- display: inline-block;
-}
-.license {
- font-size: 50%;
- text-align: center;
- max-width: 35%;
- display: block;
-}
-/* Use for long text which doesnt wrap nicely */
-.long {
- word-wrap: break-word;
-}
p {
margin-top: 1.5%;
margin-bottom: 1.5%;
@@ -70,30 +52,59 @@ code {
white-space: pre-wrap;
word-wrap: break-all;
}
-table {
- border-spacing: 0 10px;
+th {
+ text-align: center;
+ padding: 1%;
+ background-color: #cccccc;
}
td {
- text-align: left
+ text-align: center;
+ padding: 1%;
}
img {
max-width: 100%;
height: auto;
width: auto;
}
-/*mobile*/
+img.icon {
+ filter: invert(50%);
+}
+iframe {
+ border: 0;
+}
+
+.navbar {
+ text-align: center;
+ max-width: 95%;
+ display: block;
+}
+.content {
+ text-align: justify;
+ max-width: 85%;
+ display: inline-block;
+}
+.license {
+ font-size: 50%;
+ text-align: center;
+ max-width: 35%;
+ display: block;
+}
+.long {
+ word-wrap: break-word;
+}
+
@media screen and (max-device-width: 480px) {
- body {
+ body {
max-width: 100%;
font-size: 90%;
- }
- .license {
+ }
+ .license {
font-size: 0;
- }
- p {
+ }
+ p {
margin-top: 5%;
margin-bottom: 5%;
- }
+ }
code.long {
font-size: 65%;
}
diff --git a/templates/base.html b/templates/base.html
index 5ca253a..c280184 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -14,19 +14,19 @@
<div class="navbar">
<b>|</b> <!-- This makes the bar symmetrical -->
{% for dir in navbar %}
- <b> <a href="/site/{{ dir }}">{{ dir }}/</a> |</b>
+ <b> <a href="/{{ dir }}">{{ dir }}/</a> |</b>
{% endfor %}
<!-- Add icons here -->
<a href="/feed.xml"target="_blank" rel="noopener noreferrer">
<img src="https://icons.getbootstrap.com/assets/icons/rss-fill.svg">
</a>
</div>
- <h2>{{ title }}</h2>
+ <h2 class="center">{{ title }}</h2>
<div class="content">
{% block content %}
{% endblock %}
<h3 class="center">{{ errors }}</h3>
- {% if parent_dir != '/site/' %}
+ {% if parent_dir %}
<h3 class="center"><a href="{{ parent_dir }}">Go up to parent folder ({{ parent_dir }})</a></h3>
{% endif %}
</div>
diff --git a/templates/index.html b/templates/index.html
index c8356fe..b612c63 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,7 +2,7 @@
{% block content %}
<center>
{% if description %}
-{% include cur_path + '/.description' %}
+{% include '/site/' + cur_path + '/.description' %}
{% endif %}
{% if dirs %}
diff --git a/templates/site/home.html b/templates/site/home.html
index 01d676e..46c1663 100644
--- a/templates/site/home.html
+++ b/templates/site/home.html
@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% block content %}
-<p>Home</p>
+<center><p>Home</p></center>
{% endblock %}
diff --git a/views.py b/views.py
index aed9f17..4a41248 100644
--- a/views.py
+++ b/views.py
@@ -18,9 +18,8 @@ CONTENT_BLOCK = (
@app.route("/")
-@app.route("/site")
-@app.route("/site/home.html")
-@app.route("/site/index.html")
+@app.route("/home.html")
+@app.route("/index.html")
@cache.cached()
def home():
"""
@@ -31,13 +30,13 @@ def home():
"""
context = default_context()
context.update(
- {'title': app.config['HOME_TITLE'], 'parent_dir': '/site/'}
+ {'title': app.config['HOME_TITLE'], 'parent_dir': None}
)
return render_template("site/home.html", **context)
# from: https://pythonise.com/series/learning-flask/sending-files-with-flask
-@app.route("/site/<path:path>")
+@app.route("/<path:path>")
@cache.cached()
def render_file(path):
"""
@@ -55,7 +54,7 @@ def render_file(path):
context.update(
{
'title': path.split('.')[0].upper(),
- 'parent_dir': '/site/' + '/'.join(path.split('/')[:-1]),
+ 'parent_dir': '/' + '/'.join(path.split('/')[:-1]),
'last_update': file_last_modified(abs_path),
}
)
@@ -82,7 +81,7 @@ def render_file(path):
dirs, files, links, description = index_dir(abs_path)
context.update(
{
- 'cur_path': 'site/' + path,
+ 'cur_path': path,
'cur_dir': path.split('/')[-1] + '/',
'dirs': dirs,
'files': files,