From fab895ec6b74191b06db33855f28555874a62873 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Tue, 7 Feb 2023 15:02:37 +0100 Subject: [PATCH] post_db. Changes in html.py --- src/var/lib/tyto/program/html.py | 36 ++++++++++++++++---------------- src/var/lib/tyto/program/wip.py | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/var/lib/tyto/program/html.py b/src/var/lib/tyto/program/html.py index 65582cc..48c9573 100644 --- a/src/var/lib/tyto/program/html.py +++ b/src/var/lib/tyto/program/html.py @@ -52,9 +52,7 @@ def manage_configs(target, option): # Load article DB # # Start HTML page sections # #--------------------------# -def set_page(post_db, target, article_bottom): - exec(open(post_db).read(),globals()) - +def set_page(target, article_bottom): create_metas_page() # Include metas tags create_main_page(target, article_bottom) # Create main page @@ -69,20 +67,20 @@ def create_metas_page(): #------------------- metas_page = '' scale = 'width=device-width, initial-scale=1.0' - all_tags = db.domain_tags + ',' + tags + all_tags = db.domain_tags + ',' + db.tags css_file = 'template/style.css' - css_ref = 'media="screen" href="%s%s"'%(sub_uri, css_file) + css_ref = 'media="screen" href="%s%s"'%(db.sub_uri, css_file) rss_file = 'rss.xml' rss_ref = 'type="application/rss+xml" ' + \ 'href="%s%s" title="RSS 2.0. %s %s %s'%( - sub_uri, rss_file, + db.sub_uri, rss_file, db.domain_title, db.domain_sep, db.domain_short ) icon_file = 'favicon.png' icon_ref = 'type="image/png" href="%stemplate/%s"'%( - sub_uri, icon_file + db.sub_uri, icon_file ) - en_date = tyto.set_en_date(date[0]) + en_date = tyto.set_en_date(db.date[0]) relme = '' # External URL in metas (if exists in config domain) if db.domain_relme: relme = '\n '%( @@ -100,25 +98,25 @@ def create_metas_page(): ' \n'%db.domain_mail + \ ' \n'%db.domain_license + \ ' \n'%tyto.Tyto + \ - ' \n'%title + \ - ' \n'%author + \ - ' \n'%about + \ + ' \n'%db.title + \ + ' \n'%db.author + \ + ' \n'%db.about + \ ' \n'%all_tags + \ ' \n'%en_date + \ - ' \n'%http_www + \ + ' \n'%db.http_www + \ ' \n'%(rss_ref) + \ ' \n'%css_ref + \ ' \n'%icon_ref + \ ' \n' + \ ' \n'%db.domain_title + \ - ' \n'%title + \ + ' \n'%db.title + \ ' \n' + \ - ' \n'%http_www + \ - ' \n'%about + \ - ' \n'%snpic + \ + ' \n'%db.http_www + \ + ' \n'%db.about + \ + ' \n'%db.snpic + \ '%s'%relme + \ '\n' + \ - ' %s'%title + ' %s'%db.title #=======================================# @@ -140,7 +138,9 @@ def create_main_page(target, article_bottom): tyto.trans[1][tyto.n], db.domain_sep, db.domain_title ) + \ '%sid="site_logo_link">\n'%(11 * " ") + \ - '%s\n'%(15 * " ") + \ '%s'%(8 * " ") diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index aa34111..53504ec 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -115,7 +115,7 @@ def wip_article(target): tyto.replace_in_db(db.post_db, 'wip', db.hash_post) # Get article DB in html.py - html.set_page(db.post_db, db.uri_file, article_bottom) + html.set_page(db.uri_file, article_bottom) #print(html.main_page) # Create wip file