publish: template log, sitemap and feed created with article

This commit is contained in:
Cyrille L 2024-01-18 08:43:45 +01:00
parent 21b660a12d
commit 31e1f382f1
5 changed files with 22 additions and 5 deletions

View File

@ -77,6 +77,7 @@ def set_messages():
206 : langs.logs.inf_file_upd, 206 : langs.logs.inf_file_upd,
207 : langs.logs.inf_dir_create, 207 : langs.logs.inf_dir_create,
208 : langs.logs.inf_add_item, 208 : langs.logs.inf_add_item,
209 : langs.logs.inf_dir_copy,
210 : langs.logs.inf_check_post, 210 : langs.logs.inf_check_post,
211 : langs.logs.inf_wip_process, 211 : langs.logs.inf_wip_process,
212 : langs.logs.inf_mod_process, 212 : langs.logs.inf_mod_process,

View File

@ -50,11 +50,16 @@ def manage():
article(article_item) article(article_item)
# Copy sitemap if activated and exists # Copy sitemap if activated and exists
if domain.conf["sitemaps"]: try:
sitemap.create() map_feed
article("sitemap.tyto") if domain.conf["sitemaps"]:
sitemap.create()
article("sitemap.tyto")
feed.create()
except:
pass
feed.create()
tools.copy_template_dir("www") tools.copy_template_dir("www")
@ -89,21 +94,29 @@ def articles():
# Set DB, check and copy files # # Set DB, check and copy files #
#------------------------------# #------------------------------#
def article(article_item): def article(article_item):
# Set True to create feed and sitemap
global map_feed
try: map_feed
except: map_feed = False
post.set_uri(article_item) post.set_uri(article_item)
post.exists(article_item) post.exists(article_item)
db_uri = domain.wrk_dirs["db"] + post.uid + ".ini" db_uri = domain.wrk_dirs["db"] + post.uid + ".ini"
if not bool(os.path.exists(db_uri)): if not bool(os.path.exists(db_uri)):
debug.out(12, "wip %s"%article_item, post.uid, True, 2, out) debug.out(12, "wip %s"%article_item, post.uid, True, 2, out)
return
post.cf_load() post.cf_load()
if not check_db(): if not check_db():
debug.out(12, "wip %s"%article_item, post.uri, True, 2, out) debug.out(12, "wip %s"%article_item, post.uri, True, 2, out)
return
copy_wip_to_www() copy_wip_to_www()
post.cf_set("HASHES", "www", DB["hash_wip"]) post.cf_set("HASHES", "www", DB["hash_wip"])
post.cf_set("DATES", "www", pub_date) post.cf_set("DATES", "www", pub_date)
post.cf_write() post.cf_write()
debug.out(250, DB["article_title"], DB["uri_www"], True, 0, False) debug.out(250, DB["article_title"], DB["uri_www"], True, 0, False)
mam_feed = True
#=========================== #===========================

View File

@ -200,6 +200,7 @@ def copy_template_dir(process):
create_dirs(dst_dirs[process]) create_dirs(dst_dirs[process])
shutil.copytree(src_dirs[process], dst_dirs[process], dirs_exist_ok=True) shutil.copytree(src_dirs[process], dst_dirs[process], dirs_exist_ok=True)
debug.out(209, "wip/template/", dst_dirs[process], True, 0, False)
#====================================================# #====================================================#

View File

@ -82,6 +82,7 @@ inf_domain_conf = "Configuring domain"
inf_file_upd = "File updated" inf_file_upd = "File updated"
inf_file_create = "File created" inf_file_create = "File created"
inf_dir_create = "Directory created" inf_dir_create = "Directory created"
inf_dir_copy = "Directory copied"
inf_check_post = "Checking article" inf_check_post = "Checking article"
inf_wip_process = "Converting" inf_wip_process = "Converting"
inf_mod_process = "Checking modules" inf_mod_process = "Checking modules"

View File

@ -82,6 +82,7 @@ inf_domain_conf = "Configuration du domaine"
inf_file_upd = "Fichier mis à jour" inf_file_upd = "Fichier mis à jour"
inf_file_create = "Fichier créé" inf_file_create = "Fichier créé"
inf_dir_create = "Dossier créé" inf_dir_create = "Dossier créé"
inf_dir_copy = "Dossier copié"
inf_check_post = "Vérification de l'article" inf_check_post = "Vérification de l'article"
inf_wip_process = "Conversion" inf_wip_process = "Conversion"
inf_mod_process = "Vérification des modules" inf_mod_process = "Vérification des modules"