working on publish template command #4

This commit is contained in:
Cyrille L 2023-03-03 16:53:12 +01:00
parent 12f483c263
commit 5ddd69cfd3
2 changed files with 20 additions and 1 deletions

View File

@ -54,7 +54,8 @@ def tyto(target):
' - Create article\'s file in articles/ directory\n' ' - Create article\'s file in articles/ directory\n'
' - Use these actions on article\'s file: Check > wip > publish\n' ' - Use these actions on article\'s file: Check > wip > publish\n'
' ! Config\'s files are in _configs/ directory\n' ' ! Config\'s files are in _configs/ directory\n'
' and used to create HTML file in your template\n\n' ' and used to create HTML file in your template\n'
' Your template files (css, logo...) go to wip/template/ server\n\n'
'# Usage: tyto [action] [target] \n' '# Usage: tyto [action] [target] \n'
' - [action] according to [target]:\n' ' - [action] according to [target]:\n'
' edit : Edit article\'s file\n' ' edit : Edit article\'s file\n'

View File

@ -142,10 +142,28 @@ def create_template(option):
if not res in ['y', 'Y']: if not res in ['y', 'Y']:
logs.out("255", '', True) logs.out("255", '', True)
# Create new file from _configs/ files
html.create_sidebar('www') html.create_sidebar('www')
html.create_navbar('www') html.create_navbar('www')
html.create_user_metas('www') html.create_user_metas('www')
html.create_user_footer('www') html.create_user_footer('www')
# Copy all file in wip server template, except "nofiles"
nofiles = (
'footer.html',
'metas.html',
'navbar.html',
'sidebar.html'
)
for item in os.listdir(db.srv_wip_tpl):
if item.startswith(nofiles):
continue
item_src = '%s%s'%(db.srv_wip_tpl, item)
item_dst = '%s%s'%(db.srv_www_tpl, item)
if shutil.copy2(item_src, item_dst):
print(' ├ Create file:', item_dst)
#================================# #================================#
# Publish template in www server # # Publish template in www server #