diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 812d469..042d6d6 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -356,15 +356,11 @@ def create_domain(target, option): # Activate Domain #---------------- - tyto.set_file(tyto.domain_conf, False, - '\ndomain_active = True') + tyto.set_file(tyto.domain_conf, False, '\ndomain_active = True') # Load config exec(open(tyto.domain_conf).read(),globals()) - - # Create sidebar - create_sidebar(option, sidebar_dir) - + # Create folders from configuration file folders = ( srv_wip_tpl, srv_wip_images, srv_wip_files, @@ -380,12 +376,64 @@ def create_domain(target, option): if not os.makedirs(folder, exist_ok=True): print(' │ Exists directory: %s'%folder) + # Create tyto.sidebar and metas.html + print(' │') + create_sidebar(option, sidebar_dir) + create_metas_file(srv_wip_tpl) + print(' │') print(' ├──────────────────────────────────────┐') print(' │ Domain is ready. Have fun, writers ! │') print(' └──────────────────────────────────────┘') +#========================================# +# Create metas.html with default content # +#----------------------------------------# +def create_metas_file(srv_wip_tpl): + metas_file = '%smetas.html'%srv_wip_tpl + if os.path.exists(metas_file): + ask = '' + ask = input(' ├ Initialize default metas.html ? ') + if not ask in ['y', 'Y']: + return + + metas_tags = '# Custom metas\n' + \ + '# You can add HTML meta tags or edit them\n' + \ + '# As Tyto makes static pages,\n' + \ + '# for any changes, you will have to commands:\n' + \ + '# "tyto wip again" and "tyto publish again"\n' + \ + '# to apply new changes to your live articles.\n' + \ + '# ! Only and lines are used !\n' + \ + '\n' + \ + '# Already set metas with values:\n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# \n' + \ + '# # RSS\n' + \ + '# \n' + \ + '# \n' + \ + '# # if profile url in config\n' + \ + '\n' + \ + '\n' + \ + '\n' + \ + '' + + tyto.set_file(metas_file, True, metas_tags) + print(' ├ Create file: %s'%metas_file) + print(' │ ! Check this file, before starting !') + + #==============================# # sidebar load file translated # #------------------------------# @@ -431,5 +479,4 @@ def create_sidebar(opt, sidebar_dir): return tyto.set_file(sidebar_load, 'new', sdb_load) - - print(' ├ Create new file: %s'%sidebar_load) + print(' ├ Create file: %s'%sidebar_load) diff --git a/src/var/lib/tyto/program/html.py b/src/var/lib/tyto/program/html.py index 7913020..a35f2be 100644 --- a/src/var/lib/tyto/program/html.py +++ b/src/var/lib/tyto/program/html.py @@ -49,7 +49,6 @@ def create_metas_page(): metas_page = '' tab = 4 scale = 'width=device-width, initial-scale=1.0' - visit = '3 days' all_tags = domain_tags + ',' + tags post_url = domain_url + http_uri css_file = 'template/style.css' @@ -72,25 +71,26 @@ def create_metas_page(): #-------------------------------------------------- metas_file = '%smetas.html'%srv_wip_tpl user_metas = '' + metas_used = ('\n'%scale + \ '\n'%domain_url + \ - '\n' + \ - '\n' + \ - '\n'%visit + \ '\n'%domain_lang + \ '\n'%domain_mail + \ '\n'%domain_license + \ diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index c47f6c7..ad41223 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -503,7 +503,7 @@ def exiting(nbr, value, out): '21' : ':D %sValid%s article. Ready to wip'%(CG, CS), '22' : ':? %sNot paired%s symbols: %s'%(CY, CS, value), '23' : ':? %sCorrupted database%s: %s'%(CY, CS, value), - '24' : ':? %sfile missing%s (wip article): %s'%(CY, CS, value), + '24' : ':? %sfile missing%s %s'%(CY, CS, value), '25' : ':D Add contents %s'%value, '255' : ':| Maybe later...' } diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index 8d1e3db..772e23c 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -45,7 +45,7 @@ def manage_wip(target, option): wip_article(target) else: if not os.path.exists(wip_uri): - tyto.exiting("24", wip_uri, False) + tyto.exiting("24", '(wip article): %s'%wip_uri, False) wip_article(target) else: tyto.exiting("20", date_wip, True)