Compare commits

...

5 Commits

@ -7,35 +7,41 @@ import config
app = Flask(__name__)
TITLE = config.TITLE
STITLE = config.STITLE
STYLE = config.STYLE
LANGUAGE = config.LANGUAGE
DESCRIPTION = config.DESCRIPTION
WEBSITE = config.WEBSITE
MAIL = config.MAIL
@app.errorhandler(404)
def page_not_found(e):
return render_template("error.html", title=TITLE, errorcode="404", style=STYLE, language=LANGUAGE), 404
return render_template("error.html", title=TITLE, stitle=STITLE, errorcode="404", style=STYLE, language=LANGUAGE), 404
@app.route("/")
@app.route("/index.html")
def index():
content = con_gen.gen_index_string()
return render_template("index.html", title=TITLE, content_string=content, style=STYLE, language=LANGUAGE)
return render_template("index.html", title=TITLE, stitle=STITLE, content_string=content, style=STYLE, language=LANGUAGE)
@app.route("/imprint")
@app.route("/imprint.html")
def imprint():
return render_template("imprint.html", title=TITLE, stitle=STITLE, mail=MAIL, style=STYLE, language=LANGUAGE)
@app.route("/archive")
@app.route("/archive.html")
def archive():
content = con_gen.gen_arch_string()
return render_template("archive.html", title=TITLE, content_string=content, style=STYLE, language=LANGUAGE)
return render_template("archive.html", title=TITLE, stitle=STITLE, content_string=content, style=STYLE, language=LANGUAGE)
@app.route("/entry/<path>")
def entry(path):
content = con_gen.gen_stand_string(path)
if content != "":
return render_template("standalone.html", title=TITLE, content_string=content, style=STYLE, language=LANGUAGE)
return render_template("standalone.html", title=TITLE, stitle=STITLE, content_string=content, style=STYLE, language=LANGUAGE)
abort(404)

@ -1,6 +1,9 @@
# Name/title of your blog
TITLE = "Beaker Blog"
# Short name/title of your blog
STITLE = "Beaker Blog"
# Description for RSS of your blog
DESCRIPTION = "This is your personal Beaker Blog."
@ -12,3 +15,6 @@ STYLE = "dark"
# Language for the titles: en-us or de-de
LANGUAGE = "en-us"
# Mail address for the imprint
MAIL = "dummy@mail.com"

@ -27,12 +27,12 @@ def gen_arch_string():
if path.exists(path_ex):
name_list = os.listdir(path_ex)
full_list = [os.path.join(path_ex, i) for i in name_list]
contents = sorted(full_list, key=os.path.getctime)
contents = sorted(full_list, key=os.path.getmtime)
content_string = ""
last_month = ""
for file in reversed(contents):
curr_date = datetime.fromtimestamp(os.path.getctime(file)).strftime("%Y-%m-%d")
curr_month = datetime.fromtimestamp(os.path.getctime(file)).strftime("%B %Y")
curr_date = datetime.fromtimestamp(os.path.getmtime(file)).strftime("%Y-%m-%d")
curr_month = datetime.fromtimestamp(os.path.getmtime(file)).strftime("%B %Y")
if curr_month != last_month:
if last_month != "":
content_string += "</ul>\n"
@ -67,7 +67,7 @@ def gen_index_string():
if path.exists(path_ex):
name_list = os.listdir(path_ex)
full_list = [os.path.join(path_ex, i) for i in name_list]
contents = sorted(full_list, key=os.path.getctime)
contents = sorted(full_list, key=os.path.getmtime)
for file in reversed(contents):
filename = pathlib.PurePath(file)
purefile = filename
@ -82,12 +82,11 @@ def gen_index_string():
pathlib.PurePath(file).name + "\">" + \
title + "</a>" +"</h2>\n"
content_string += "<small>" + \
datetime.fromtimestamp(os.path.getctime(
datetime.fromtimestamp(os.path.getmtime(
file)).strftime("%Y-%m-%d") + "</small><br><br>"
if file.endswith(".html"):
for line in text:
content_string += line
content_string += "<br>"
if file.endswith(".md"):
content_string += gen_md_content(file, 2)
content_string += "</div>"
@ -111,7 +110,7 @@ def gen_stand_string(path_ex):
if path.exists(filename):
title = open(filename).readline().rstrip("\n")
text = open(filename).readlines()[1:]
curr_date = datetime.fromtimestamp(os.path.getctime(filename)).strftime("%Y-%m-%d")
curr_date = datetime.fromtimestamp(os.path.getmtime(filename)).strftime("%Y-%m-%d")
filename_no_end = filename.split(".", 1)[0]
filename_no_end = filename_no_end.split("/")[-1]
content_string += "<h1>" + title + "</h1>\n"
@ -165,7 +164,7 @@ def get_rss_string():
if path.exists(path_ex):
name_list = os.listdir(path_ex)
full_list = [os.path.join(path_ex, i) for i in name_list]
contents = sorted(full_list, key=os.path.getctime)
contents = sorted(full_list, key=os.path.getmtime)
content_string = ""
for file in reversed(contents):
filename = pathlib.PurePath(file)
@ -179,7 +178,7 @@ def get_rss_string():
content_string += "<guid>" + config.WEBSITE + \
"/index.html#" + filename + "</guid>\n"
content_string += "<pubDate>" + \
datetime.fromtimestamp(os.path.getctime(file)).strftime(
datetime.fromtimestamp(os.path.getmtime(file)).strftime(
"%Y-%m-%d") + "</pubDate>\n"
content_string += "<description>"
for line in text:

@ -51,11 +51,13 @@ span {
.hide-menu:hover,
.main-menu a:hover,
.main-menu-dropdown a:hover,
.show-menu:hover {
color: var(--menulink1);
}
.main-menu a {
.main-menu a,
.main-menu-dropdown a {
color: var(--menulink0);
}

@ -59,11 +59,13 @@ span {
.hide-menu:hover,
.main-menu a:hover,
.main-menu-dropdown a:hover,
.show-menu:hover {
color: var(--menulink1);
}
.main-menu a {
.main-menu a,
.main-menu-dropdown a {
color: var(--menulink0);
}

@ -80,7 +80,8 @@ footer .center {
.main-menu-dropdown img {
float: left;
}
.main-menu-dropdown span {
.main-menu-dropdown span,
.main-menu-dropdown a {
float: left;
font-family: Georgia, serif;
font-size: 30px;
@ -159,12 +160,30 @@ footer .center {
.entry {
border-radius: 0 10px 30px 0;
margin-bottom: 20px;
padding: 10px;
padding-left: 20px;
}
h1, h2 {
padding-top: 20px;
padding-bottom: 20px;
}
h3 {
padding-top: 10px;
padding-bottom: 10px;
}
.entry h1,
.entry h2 {
margin: 5px auto 2px auto;
.imprint h1:first-child {
padding-bottom: 20px;
}
.blog h1:first-child {
padding-bottom: 20px;
}
.entry h2:first-child {
padding-top: 0;
padding-bottom: 0;
}
.entry ul {
@ -172,7 +191,12 @@ footer .center {
}
figure {
padding:20px;
padding-top: 20px;
padding-bottom: 20px;
}
.entry figure:last-child {
padding-bottom:0
}
ul {

@ -0,0 +1,91 @@
{% extends "template.html" %}
{% block content %}
<div class="container">
<div class="imprint">
<h1>{% if language=="de-de" %}Impressum{% else %}Imprint{% endif %}</h1><br>
{% if language=="de-de" %}
<h2>Kontakt:</h2>
<ul>
<li><a href='mailto:{{ mail }}'>E-Mail</a></li>
</ul>
<h2>Haftungsausschluss:</h2>
<h3>Haftung für Inhalte</h3>
<p>
Die Inhalte unserer Seiten wurden mit größter Sorgfalt erstellt. Für die Richtigkeit, Vollständigkeit und
Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1
TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 TMG sind
wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu
überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur
Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt.
Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntnis einer konkreten Rechtsverletzung
möglich. Bei Bekanntwerden von entsprechenden Rechtsverletzungen werden wir diese Inhalte umgehend
entfernen.
</p>
<h3>Haftung für Links</h3>
<p>
Unser Angebot enthält Links zu externen Webseiten Dritter, auf deren Inhalte wir keinen Einfluss haben. Deshalb
können wir für diese fremden Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten Seiten ist
stets der jeweilige Anbieter oder Betreiber der Seiten verantwortlich. Die verlinkten Seiten wurden zum
Zeitpunkt der Verlinkung auf mögliche Rechtsverstöße überprüft. Rechtswidrige Inhalte waren zum Zeitpunkt der
Verlinkung nicht erkennbar. Eine permanente inhaltliche Kontrolle der verlinkten Seiten ist jedoch ohne konkrete
Anhaltspunkte einer Rechtsverletzung nicht zumutbar. Bei Bekanntwerden von Rechtsverletzungen werden wir
derartige Links umgehend entfernen.
</p>
<h3>Urheberrecht</h3>
<p>
Die durch die Seitenbetreiber erstellten Inhalte und Werke auf diesen Seiten unterliegen dem deutschen
Urheberrecht. Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung außerhalb der Grenzen
des Urheberrechtes bedürfen der schriftlichen Zustimmung des jeweiligen Autors bzw. Erstellers. Downloads und
Kopien dieser Seite sind nur für den privaten, nicht kommerziellen Gebrauch gestattet. Soweit die Inhalte auf
dieser Seite nicht vom Betreiber erstellt wurden, werden die Urheberrechte Dritter beachtet. Insbesondere werden
Inhalte Dritter als solche gekennzeichnet. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam
werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir
derartige Inhalte umgehend entfernen.
</p>
{% else %}
<h2>Contact:</h2>
<p><a href='mailto:{{ mail }}'>E-Mail</a></p>
<h2>Disclaimer:</h2>
<h3>Liability for Content</h3>
<p>
The contents of our website have been created with the greatest possible care. However, we cannot guarantee the
contents' accuracy, completeness, or topicality. According to Section 7, paragraph 1 of the TMG (Telemediengesetz
-
German Telemedia Act), we as service providers are liable for our content on these pages by general laws. However,
according to Sections 8 to 10 of the TMG, we service providers are not obliged to monitor external information
transmitted or stored or investigate circumstances pointing to illegal activity. Obligations to remove or block
the
use of information under general laws remain unaffected. However, a liability in this regard is only possible from
the moment of knowledge of a specific infringement. Upon notification of such violations, we will remove the
content
immediately.
</p>
<h3>Liability for Links</h3>
<p>
Our website contains links to external websites, over whose contents we have no control. Therefore, we cannot
accept
any liability for these external contents. The respective provider or operator of the websites is always
responsible
for the contents of the linked pages. The linked pages were checked for possible legal violations at the time of
linking. Illegal contents were not identified at the time of linking. However, permanent monitoring of the
contents
of the linked pages is not reasonable without specific indications of a violation. Upon notification of
violations,
we will remove such links immediately.
</p>
<h3>Copyright</h3>
<p>
The contents and works on these pages created by the site operator are subject to German copyright law. The
duplication, processing, distribution, and any kind of utilization outside the limits of copyright require the
written consent of the respective author or creator. Downloads and copies of these pages are only permitted for
private, non-commercial use. In so far as the contents on this site were not created by the operator, the
copyrights
of third parties are respected. In particular, third-party content is marked as such. Should you become aware of a
copyright infringement, please inform us accordingly. Upon notification of violations, we will remove such
contents
immediately.
</p>
{% endif %}
</div>
</div>
{% endblock %}

@ -11,7 +11,7 @@
<div class="main-menu-dropdown">
<a href="{{ url_for('index') }}">
<img class="logo" src="{{ url_for('static', filename='graphics/logo.png') }}">
<span>{{ title }}</span>
{{ stitle }}
</a>
<input type="checkbox" id="main-menu-check">
<label for="main-menu-check" class="show-menu">&#9776;</label>
@ -28,6 +28,9 @@
<!-- Content -->
<footer>
<div class="center">
<a href="{{ url_for('imprint') }}">
{% if language=="de-de" %}Impressum und Kontakt{% else %}Imprint and Contact{% endif %}
</a><br>
Made with <a href="https://github.com/tiyn/beaker-blog">Beaker Blog</a>.
</div>
</footer>

Loading…
Cancel
Save