8442241be0a4 — Eddie Barraco 5 years ago
The owner name is now configurable
2 files changed, 6 insertions(+), 1 deletions(-)

M cogito2/app.py
M cogito2/templates/base.html
M cogito2/app.py +5 -0
@@ 2,6 2,7 @@ from .database.filerepository import get
 from .database.article_factory import build_from_posix_file, build_from_posix_files
 from .database.markdown import get_html
 from math import ceil
+from os import environ
 
 from flask import Flask, render_template, abort, request
 app = Flask(__name__)

          
@@ 26,3 27,7 @@ def article_show(id):
         abort(404)
 
     return render_template('show.html', article=article)
+
+@app.template_filter('env')
+def env_filter(key, default):
+    return environ.get(key, default)

          
M cogito2/templates/base.html +1 -1
@@ 9,7 9,7 @@ 
     <body>
         <div class="container">
             <div class="page-title">
-                <h1>The Eddie Barraco's blog</h1>
+              <h1>The {{ 'OWNER_NAME' | env('OWNER NAME') }}'s blog</h1>
             </div>
             <div class="content">
                 <article>