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' + \ + '
\n' + \ + ' \n' + \ + '\n' + \ + '
\n' + \ + ' \n' + \ + '

%s

\n'%domain_title + \ + '
\n' + \ + '

%s

\n'%domain_about + \ + '
\n' + \ + '%s'%menu_html + \ + '
\n' + \ + '\n' + \ + '
\n' + \ + '%s\n'%article_bottom + \ + '
\n' + \ + '\n' + \ ' \n' + \ '' diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index c155ffd..0e5b541 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -90,8 +90,9 @@ else: n = 1 # Translations French/English trans = [ - ['À l\'affiche !', 'Featured !' ] - ] +['À l\'affiche !', 'Featured !' ], #0 +['Accueil', 'Home'] #1 +] # Set all tags used in article's header diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index 99f249e..e34ea93 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -118,10 +118,10 @@ def wip_article(target): wip_tabs() # make HTML tabulations # Result (temp display) - print(article_bottom) + #print(article_bottom) # Get article DB in html.py - html.set_page(post_db) + html.set_page(post_db, target, article_bottom) print(html.main_page) # Replace in DB hash_wip and date_wip @@ -629,7 +629,7 @@ def wip_raws(target): def wip_tabs(): global article_bottom article_temp = '' - tab = tab_start = 8 # From
tag + tab = tab_start = 2 # From
tag indiv = False for line in article_bottom.rsplit('\n'):