From 2495b97b0ba33f3e7bf96e09d4a6c8dc7ac5107e Mon Sep 17 00:00:00 2001 From: mjfernez Date: Sun, 24 Dec 2023 12:41:02 -0500 Subject: Update SEO, grab meta descriptions from .desc Keyword tags are outdated so those have been removed. Descriptions are more important that SEO. The description of the parent directory is used --- views.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'views.py') 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, -- cgit v1.2.3