aboutsummaryrefslogtreecommitdiffstats
path: root/views.py
diff options
context:
space:
mode:
authormjfernez <mjf@mjfer.net>2023-12-24 12:41:02 -0500
committermjfernez <mjf@mjfer.net>2023-12-24 12:41:02 -0500
commit2495b97b0ba33f3e7bf96e09d4a6c8dc7ac5107e (patch)
tree6ca0ebc918e53f9e74152559f81d18d794dfb960 /views.py
parentad7a378b801b0071182ef3205867d55a7697f775 (diff)
downloadezcms-2495b97b0ba33f3e7bf96e09d4a6c8dc7ac5107e.tar.gz
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
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,