html: in very ealy dev
This commit is contained in:
parent
d24600f1eb
commit
7945f5473f
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python3
|
||||
# Name: Tyto - Littérateur
|
||||
# Type: Global functions for HTML page
|
||||
# Description: Create final HTML Page
|
||||
# file: html.py
|
||||
# Folder: /var/lib/tyto/programs/
|
||||
# By echolib (XMPP: im@echolib.re)
|
||||
# License: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
|
||||
|
||||
#------------
|
||||
# funny stats
|
||||
#------------
|
||||
# lines:
|
||||
# functions:
|
||||
# comments:
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
#**********************************************************************
|
||||
import check, log, domain
|
||||
|
||||
def html_main_page():
|
||||
# Source DB variables
|
||||
post_db = exec(open(check.curr_post_db).read(),globals())
|
||||
|
||||
# Metas in HTML page
|
||||
scale = 'width=device-width, initial-scale=1.0'
|
||||
visit = '3 days'
|
||||
title = '%s %s %s'%(post_title, domain.sep_titles, domain.domain_title)
|
||||
tags = '%s,%s'%(domain.domain_tags, post_tags)
|
||||
|
||||
metas = '<meta charset="UTF-8" />\n' + \
|
||||
'<meta name="viewport" content="%s">\n'%scale + \
|
||||
'<meta name="robots" content="all">\n' + \
|
||||
'<meta name="medium" content="website">\n' + \
|
||||
'<meta name="revisit-after" content="%s">\n'%visit + \
|
||||
'<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="title" content="%s">\n'%title + \
|
||||
'<meta name="author" content="%s">\n'%post_author + \
|
||||
'<meta name="description" content="%s">\n'%post_about + \
|
||||
'<meta name="keywords" content="%s">\n'%tags + \
|
||||
'<meta name="search_date" content="%s">\n'%post_date + \
|
||||
'<title>%s</title>\n'%title
|
||||
|
||||
print(metas)
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#**********************************************************************
|
||||
import sys, os, re
|
||||
import check, log, domain
|
||||
import check, log, domain, html
|
||||
|
||||
Post_Err = False
|
||||
|
||||
|
@ -116,6 +116,9 @@ def manage_wip(file_post, Force):
|
|||
print('> Article with Tabs:')
|
||||
tab_article(wip_html.rsplit('\n'))
|
||||
|
||||
# Create full page
|
||||
html.html_main_page()
|
||||
|
||||
|
||||
|
||||
#============================#
|
||||
|
@ -563,14 +566,12 @@ def wip_bruts(article):
|
|||
global wip_html
|
||||
|
||||
wip_html = ''
|
||||
|
||||
all_vars = set(globals())
|
||||
|
||||
for var in all_vars:
|
||||
if var.startswith('brut_'):
|
||||
brut = globals()[var]
|
||||
|
||||
|
||||
# Search in article lines for _image:
|
||||
for line in article:
|
||||
if not line.startswith('_brut:'):
|
||||
|
|
Loading…
Reference in New Issue