publish: template log, sitemap and feed created with article
This commit is contained in:
parent
21b660a12d
commit
31e1f382f1
|
@ -77,6 +77,7 @@ def set_messages():
|
|||
206 : langs.logs.inf_file_upd,
|
||||
207 : langs.logs.inf_dir_create,
|
||||
208 : langs.logs.inf_add_item,
|
||||
209 : langs.logs.inf_dir_copy,
|
||||
210 : langs.logs.inf_check_post,
|
||||
211 : langs.logs.inf_wip_process,
|
||||
212 : langs.logs.inf_mod_process,
|
||||
|
|
|
@ -50,11 +50,16 @@ def manage():
|
|||
article(article_item)
|
||||
|
||||
# Copy sitemap if activated and exists
|
||||
if domain.conf["sitemaps"]:
|
||||
sitemap.create()
|
||||
article("sitemap.tyto")
|
||||
try:
|
||||
map_feed
|
||||
if domain.conf["sitemaps"]:
|
||||
sitemap.create()
|
||||
article("sitemap.tyto")
|
||||
|
||||
feed.create()
|
||||
except:
|
||||
pass
|
||||
|
||||
feed.create()
|
||||
tools.copy_template_dir("www")
|
||||
|
||||
|
||||
|
@ -89,21 +94,29 @@ def articles():
|
|||
# Set DB, check and copy files #
|
||||
#------------------------------#
|
||||
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.exists(article_item)
|
||||
db_uri = domain.wrk_dirs["db"] + post.uid + ".ini"
|
||||
if not bool(os.path.exists(db_uri)):
|
||||
debug.out(12, "wip %s"%article_item, post.uid, True, 2, out)
|
||||
return
|
||||
|
||||
post.cf_load()
|
||||
if not check_db():
|
||||
debug.out(12, "wip %s"%article_item, post.uri, True, 2, out)
|
||||
return
|
||||
|
||||
copy_wip_to_www()
|
||||
post.cf_set("HASHES", "www", DB["hash_wip"])
|
||||
post.cf_set("DATES", "www", pub_date)
|
||||
post.cf_write()
|
||||
debug.out(250, DB["article_title"], DB["uri_www"], True, 0, False)
|
||||
mam_feed = True
|
||||
|
||||
|
||||
#===========================
|
||||
|
|
|
@ -200,6 +200,7 @@ def copy_template_dir(process):
|
|||
|
||||
create_dirs(dst_dirs[process])
|
||||
shutil.copytree(src_dirs[process], dst_dirs[process], dirs_exist_ok=True)
|
||||
debug.out(209, "wip/template/", dst_dirs[process], True, 0, False)
|
||||
|
||||
|
||||
#====================================================#
|
||||
|
|
|
@ -82,6 +82,7 @@ inf_domain_conf = "Configuring domain"
|
|||
inf_file_upd = "File updated"
|
||||
inf_file_create = "File created"
|
||||
inf_dir_create = "Directory created"
|
||||
inf_dir_copy = "Directory copied"
|
||||
inf_check_post = "Checking article"
|
||||
inf_wip_process = "Converting"
|
||||
inf_mod_process = "Checking modules"
|
||||
|
|
|
@ -82,6 +82,7 @@ inf_domain_conf = "Configuration du domaine"
|
|||
inf_file_upd = "Fichier mis à jour"
|
||||
inf_file_create = "Fichier créé"
|
||||
inf_dir_create = "Dossier créé"
|
||||
inf_dir_copy = "Dossier copié"
|
||||
inf_check_post = "Vérification de l'article"
|
||||
inf_wip_process = "Conversion"
|
||||
inf_mod_process = "Vérification des modules"
|
||||
|
|
Loading…
Reference in New Issue