diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 453d021..fb277f4 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -94,9 +94,10 @@ def manage_check(target, option): post_bottom = tyto.protect_article.rsplit('\n') article_bottom = tyto.protect_article - # Count words in article. Not from quotes, block-codes, icode = 1 + # Count words in article. Quotes, block-codes, icode = 1 per each post_words = len(article_bottom.strip().split(" ")) + # Check for valid contents check_content(post_bottom) post_bottom = article_bottom.rsplit('\n') diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index 042d6d6..2ca6db6 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -197,6 +197,17 @@ def create_domain(target, option): 'domain_tags = "%s"'%domain_tags) + # Get logo's website + #------------------- + try: domain_logo = tyto.domain_logo + except: domain_logo = 'logo.png' + + ask = '' + ask = input(' ├ logo filename ? ("%s") '%domain_logo) + tyto.set_file(tyto.domain_conf, False, + 'domain_logo = "%s"'%domain_logo) + + # Get License domain #------------------- try: domain_license = tyto.domain_license @@ -272,7 +283,22 @@ def create_domain(target, option): tyto.set_file(tyto.domain_conf, False, 'domain_relme = "%s"'%domain_relme) + + # Activate menu bar from root articles folders ? + #----------------------------------------------- + try: domain_menubar = tyto.domain_menubar + except: domain_menubar = 'False' + ask = '' + ask = input(' ├ Use sub-folders as menu bar ? (%s) '%domain_menubar) + + if ask in ['y', 'Y']: domain_menubar = "True" + else: domain_menubar = 'False' + + tyto.set_file(tyto.domain_conf, False, + 'domain_menubar = %s'%(domain_menubar)) + + # Sidebar Title #-------------- try: sidebar_title = tyto.sidebar_title diff --git a/src/var/lib/tyto/program/html.py b/src/var/lib/tyto/program/html.py index a35f2be..c869dd6 100644 --- a/src/var/lib/tyto/program/html.py +++ b/src/var/lib/tyto/program/html.py @@ -31,11 +31,11 @@ tytoweb = 'https://tyto.echolib.re' # Load article DB # # Start HTML page sections # #--------------------------# -def set_page(post_db): +def set_page(post_db, target, article_bottom): exec(open(post_db).read(),globals()) - create_metas_page() # Include metas tags - create_main_page() # At last, create main page + create_metas_page() # Include metas tags + create_main_page(target, article_bottom) # At last, create main page #============================================# @@ -119,15 +119,99 @@ def create_metas_page(): #=======================================# # Set main page, with all HTML sections # #---------------------------------------# -def create_main_page(): +def create_main_page(target, article_bottom): global main_page - main_page = '\n' + \ + # Create link for website's logo + #------------------------------- + logo_html = '\n'%(11 * " ") + \ + '%s\n'%(15 * " ", domain_title) + \ + '%sid="site_logo_image">\n'%(15 * " ") + \ + '%s'%(8 * " ") + + #------------------------------------# + # Create HTML menu from root folders # + #------------------------------------# + menu_html = '' + + # Conditions to create navbar + #---------------------------- + # True in config + if domain_menubar: + # Filter these directories + nodirs = ('files', 'images', 'sidebar') + + # Open HTML tags + menu_html = '%s\n'%(menu_html, 8 * ' ', 6 * ' ') + + + #-----------------------# + # Create main HTML Page # + #-----------------------# + main_page = '\n' + \ '\n'%domain_lang + \ '
\n' + \ '%s\n'%metas_page + \ ' \n\n' + \ ' \n' + \ - '%s\n' + \ + '%s
\n'%domain_about + \ + '