main
km0 1 year ago
parent 67e52efbd2
commit 3c7feb277c

@ -7,8 +7,10 @@ from flask import (Flask, redirect, render_template, request,
send_from_directory, url_for)
from markdown import markdown
from datetime import datetime
from prefix import PrefixMiddleware
load_dotenv()
PORT = os.environ.get("PORT", 3000)
@ -38,9 +40,11 @@ def render():
],
)
entries.append(html)
last_update = datetime.now().strftime('%d-%m-%y %H:%M:%S')
with open("index.html", "w") as r:
r.write(render_template("render.html", contents=entries))
r.write(render_template("render.html", contents=entries, last_update=last_update))
return "rendered"

@ -8,6 +8,23 @@ html, body {
font-family: serif;
}
header {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 64px;
}
.last-update {
text-transform: lowercase;
font-family: sans-serif;
font-size: 0.75rem;
margin: 1em;
color: #aaa;
}
.chapter {
max-width: 80ch;
margin-inline: auto;
@ -24,7 +41,9 @@ h1, h2, h3 {
}
h2 {
color: tomato;
color: white;
background-color: black;
width: fit-content;
margin: 128px auto;
text-align: center;
}

@ -6,7 +6,12 @@
<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">
</head>
<body>
<header>
<img class="cover" src="https://git.xpub.nl/kamo/thesis/raw/branch/main/cover.jpg" alt="two frogmouth and a thesis about documentation">
<div class="info">This page is generated with <a href="https://git.xpub.nl/kamo/readme">Readme</a>, fetching contents from this <a href="https://git.xpub.nl/kamo/thesis/">thesis repository</a></div>
<div class="last-update">Last update: {{ last_update }}</div>
</header>
{% for content in contents %}
<section class="chapter">

Loading…
Cancel
Save