html: in-dev template files

This commit is contained in:
Cyrille L 2022-11-24 00:56:55 +01:00
parent b565238eea
commit f2d1f341dd
1 changed files with 33 additions and 21 deletions

View File

@ -19,6 +19,9 @@
import re, os
import check, log, domain
Tyto = 'Tyto - Littérateur'
tytogen = 'https://git.a-lec.org/echolib/tyto-litterateur'
tytourl = 'https://tyto.echolib.re'
trans = [
[ 'Licence', 'License' ], # 0
[ 'Générateur', 'Generator' ], # 1
@ -26,8 +29,9 @@ trans = [
[ 'Envoyer un courriel à', 'Send a mail to' ], # 3
[ 'Détails de la licence', 'License\'s details'], # 4
[ 'Courriel', 'Mail' ], # 5
[ 'Site web généré par', 'Website generated by'], # 6
[ 'Syndication de', 'Syndication of' ] # 7
[ 'Site web généré par %s'%Tyto, 'Website generated by %s'%Tyto ], # 6
[ 'Syndication de', 'Syndication of' ], # 7
[ 'Site officiel de %s'%Tyto, 'Official website of %s'%Tyto ] # 8
]
#=======================================#
@ -71,7 +75,6 @@ def html_main_page(wip_html):
# Check here for template files
files_uri = (
'%s%s'%(domain.srv_wip, f_rss[1:len(f_rss)]),
'%s%s'%(domain.srv_wip, icon[1:len(icon)]),
'%s%s'%(domain.srv_wip, f_css[1:len(f_css)]),
'%s%s'%(domain.srv_wip, logo[1:len(logo)])
@ -100,7 +103,7 @@ def html_main_page(wip_html):
'<meta name="language" content="%s">\n'%domain.domain_lang + \
'<meta name="reply-to" content="%s">\n'%domain.domain_mail + \
'<meta name="copyright" content="%s">\n'%domain.domain_license + \
'<meta name="generator" content="Tyto - Littérateur">\n' + \
'<meta name="generator" content="%s">\n'%Tyto + \
'<meta name="title" content="%s">\n'%title + \
'<meta name="author" content="%s">\n'%post_author + \
'<meta name="description" content="%s">\n'%post_about + \
@ -140,7 +143,9 @@ def html_main_page(wip_html):
' </div>\n' + \
'</header>\n'
# Article (in section, including aside)
#--------------------------------------
articles = '<section id="page-wrapper">\n' + \
' <article id="article_%s" class="%s">\n'%(
post_ID, domain.domain_css
@ -168,9 +173,9 @@ def html_main_page(wip_html):
' </div>\n' + \
'</aside>'
# Footer, and of page
#--------------------
tytogen = 'https://git.a-lec.org/echolib/tyto-litterateur'
footers = '<footer id="footer">\n' + \
' <h1 id="footer-title">%s %s</h1>\n'%(
trans[2][fl], domain.domain_title) + \
@ -199,22 +204,27 @@ def html_main_page(wip_html):
domain.domain_license
) + \
' </li>\n' + \
' <li class="site-list"><abbr title="Really Simple Syndication">RSS</abbr>: \n' + \
' <li class="site-list">\n' + \
' <abbr title="Really Simple Syndication">RSS</abbr>: \n' + \
' <a id="site-rss" href="/rss.xml"\n' + \
' type="application/rss+xml"' + \
' title="%s %s">/rss.xml</a>\n'%(
trans[7][fl], domain.domain_title
) + \
' </li>\n' + \
' <li class="site-list">%s: \n'%trans[1][fl] + \
' <a id="tytourl" href="%s"\n'%tytourl + \
' title="%s">%s</a> \n'%(trans[6][fl], Tyto) + \
' <a id="tytogen" href="%s"\n'%tytogen + \
' type="application/rss+xml"\n' + \
' title="%s Tyto - Littérateur">Tyto - Littérateur</a>\n'%trans[6][fl] + \
' title="%s">(Code)</a>\n'%(trans[8][fl]) + \
' </li>\n' + \
' </ul>\n' + \
' </div>\n' + \
'</footer>'
# Create file if not exists
#--------------------------
files_tpl = [
[ '%smetas.html'%domain.srv_wip_template, metas ],
[ '%sheader.html'%domain.srv_wip_template, headers ],
@ -240,7 +250,9 @@ def html_main_page(wip_html):
page = '%s\n%s%s'%(page, 6*' ', meta)
page = '%s\n%s</head>\n'%(page, 4*' ') + \
'%s\n <body id="%s" class="%s">'%(4*' ', post_ID, domain.domain_css)
'\n%s<body id="%s" class="%s">'%(
4*' ', post_ID, domain.domain_css
)
# Add tab header in page
for header in headers.rsplit('\n'):
@ -266,5 +278,5 @@ def html_main_page(wip_html):
for footer in footers.rsplit('\n'):
page = '%s\n%s%s'%(page, 4*' ', footer)
#print(page)
print(page)