aboutsummaryrefslogtreecommitdiffstats
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/views.py b/views.py
index fda6152..aabe2a8 100644
--- a/views.py
+++ b/views.py
@@ -29,7 +29,11 @@ def home():
"""
context = default_context()
context.update(
- {'title': app.config['HOME_TITLE'], 'parent_dir': None}
+ {
+ 'title': app.config['HOME_TITLE'],
+ 'parent_dir': None,
+ 'description': load_description(siteconfig.BASE_DIR)
+ }
)
return render_template("site/home.html", **context)
@@ -49,13 +53,16 @@ def render_file(path):
abort(404)
abs_path = siteconfig.BASE_DIR + path
+ parent_dir = '/' + '/'.join(path.split('/')[:-1])
context = default_context()
if os.path.isfile(abs_path):
+ description = load_description(siteconfig.BASE_DIR + parent_dir)
context.update(
{
'title': path.split('.')[0].upper(),
- 'parent_dir': '/' + '/'.join(path.split('/')[:-1]),
+ 'parent_dir': parent_dir,
'last_update': file_last_modified(path),
+ 'description': description
}
)
if abs_path.endswith('.html'):
@@ -81,7 +88,7 @@ def render_file(path):
context.update(
{
'title': path.split('.')[0].upper(),
- 'parent_dir': '/' + '/'.join(path.split('/')[:-1]),
+ 'parent_dir': parent_dir,
'cur_path': path,
'cur_dir': path.split('/')[-1] + '/',
'dirs': dirs,