1
0
mirror of https://github.com/tiyn/beaker-blog.git synced 2025-04-19 07:17:48 +02:00

Compare commits

..

No commits in common. "b2676f6bd982a9eafbfd80f4ac1a6a226c78b595" and "3bd8877b5dc621b367fd9803b95e9593a9915e3d" have entirely different histories.

6 changed files with 25 additions and 23 deletions

View File

@ -43,7 +43,7 @@ You have to specify the filetype by extension.
### PIP/Python
- `git clone https://github.com/tiyn/beaker-blog`
- `cd beaker-blog/src`
- `cd tiyny-blog/src`
- edit the `config.py` file according to your needs
- `pip3install -r requirements.txt` - install depenencies
- run `python app.py`

View File

@ -13,41 +13,41 @@ WEBSITE = config.WEBSITE
@app.errorhandler(404)
def page_not_found(e):
return render_template("error.html", title=TITLE, errorcode="404", style=STYLE), 404
return render_template('error.html', title=TITLE, errorcode='404', style=STYLE), 404
@app.route("/")
@app.route("/index.html")
@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)
return render_template('index.html', title=TITLE, content_string=content, style=STYLE)
@app.route("/archive")
@app.route("/archive.html")
@app.route('/archive')
@app.route('/archive.html')
def blog_archive():
content = con_gen.gen_arch_string()
return render_template("archive.html", title=TITLE, content_string=content, style=STYLE)
return render_template('archive.html', title=TITLE, content_string=content, style=STYLE)
@app.route("/entry/<path>")
@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)
if content != '':
return render_template('standalone.html', title=TITLE, content_string=content, style=STYLE)
abort(404)
@app.route("/feed.xml")
@app.route("/rss.xml")
@app.route('/feed.xml')
@app.route('/rss.xml')
def feed():
content = con_gen.get_rss_string()
rss_xml = render_template("rss.xml", content_string=content, title=TITLE,
rss_xml = render_template('rss.xml', content_string=content, title=TITLE,
description=DESCRIPTION, website=WEBSITE)
response = make_response(rss_xml)
response.headers["Content-Type"] = "application/rss+xml"
response.headers['Content-Type'] = 'application/rss+xml'
return response
if __name__ == "__main__":
app.run(host="0.0.0.0")
if __name__ == '__main__':
app.run(host='0.0.0.0')

View File

@ -1,11 +1,11 @@
# Name/title of your blog
TITLE = "Beaker Blog"
TITLE = 'Beaker Blog'
# Description for RSS of your blog
DESCRIPTION = "This is your personal Beaker Blog."
DESCRIPTION = 'This is your personal Beaker Blog.'
# URL for your website: e.g. https://domain.tld
WEBSITE = "localhost:5000"
WEBSITE = 'localhost:5000'
# Theme for the blog: dark, light
STYLE = "dark"
STYLE = 'dark'

View File

@ -1,3 +1,4 @@
import datetime
from datetime import datetime
import markdown
import os
@ -8,6 +9,7 @@ import config
ENTRY_DIR = 'templates/entry'
def gen_arch_string():
"""
Creates and returns a archive string of every file in ENTRY_DIR.

View File

@ -1,4 +1,4 @@
{% extends "template.html" %}
{% extends 'template.html' %}
{% block content %}
<div class="container">
<div class="blogarchive">

View File

@ -1,4 +1,4 @@
{% extends "template.html" %}
{% extends 'template.html' %}
{% block content %}
<div class="container">
<div class="standalone">