diff --git a/CHANGELOG.md b/CHANGELOG.md index d07dd24..f55a244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ Tyto - Littérateur - Changelog: https://git.a-lec.org/echolib/tyto-litterateur/-/blob/master/CHANGELOG.md - License: https://git.a-lec.org/echolib/tyto-litterateur/-/blob/master/LICENSE +## [0.10.0] +- Add full static page option (--static) only with wip +- Add
@@ -207,7 +203,7 @@ optionnels `_xxx:`. Pour la date, utilisez le FORMAT INTERNATIONAL
# Source: citation complète
[[ CSS_TEST
_cite: echolib
-_date: 2022-12-28
+_date: 2022-12-28 (format AAAA ou AAAA-MM ou AAAA-MM-JJ)
_lang: fr
_link: https://tyto.echolib.re
_book: Référence
@@ -215,29 +211,10 @@ _book: Référence
Pfff, vraiment !
))
]]
-
-# HTML
-
````
```
# Source: citation basique
[[
Une citation simple, et sans paragraphe
]]
-
-# HTML
-
- Une citation simple, et sans paragraphe
-
```
diff --git a/debian/control b/debian/control
index 962e249..59ae9da 100644
--- a/debian/control
+++ b/debian/control
@@ -1,5 +1,5 @@
Package: tyto
-Version: 0.9.0
+Version: 0.10.0
Section: custom
Priority: optional
Architecture: all
diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto
index 39b0751..c6c2314 100755
--- a/src/usr/bin/tyto
+++ b/src/usr/bin/tyto
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Version: 0.9.1
+# Version: 0.10.0
# Tyto - Littérateur
#
# Copyright (C) 2023 Cyrille Louarn
diff --git a/src/var/lib/tyto/help/styles.css b/src/var/lib/tyto/help/styles.css
index 31ccc5c..2dacdf7 100644
--- a/src/var/lib/tyto/help/styles.css
+++ b/src/var/lib/tyto/help/styles.css
@@ -37,7 +37,7 @@ p#site_about {
nav#site_menu {
}
-ul#site_menu_items {
+menu#site_menu_items {
}
li.site_menu_item {
@@ -121,7 +121,7 @@ p.bcode {
}
/* section for author and date */
-section#article_infos {
+div#article_infos {
}
span#article_author {
}
@@ -157,6 +157,11 @@ p.sidebar_item_about {
*/
footer#footer_page {
}
+
+/* container for footer_infos + footer_references */
+div#footer_container {
+}
+
/* Block*/
div#footer_infos {
}
@@ -164,6 +169,7 @@ h1#footer_site_title {
}
p#footer_about {
}
+
/* Block */
div#footer_references {
}
@@ -173,6 +179,7 @@ li.footer_item {
}
a.footer_item_link {
}
+
/* Block */
div#footer_credits {
}
diff --git a/src/var/lib/tyto/program/args.py b/src/var/lib/tyto/program/args.py
index 102b140..656df18 100644
--- a/src/var/lib/tyto/program/args.py
+++ b/src/var/lib/tyto/program/args.py
@@ -60,10 +60,12 @@ actions = \
'publish'
)
-pass_actions = (
- 'new'
-
- )
+option = \
+(
+'--static',
+)
+
+pass_actions = ('new')
# Actions that needs to check for article's database
pass_db = \
@@ -104,24 +106,26 @@ pass_status = \
multi_chk = ('added', 'again', 'updated')
+'''
action = ''
target = ''
-noaction = False
+option = ''
+'''
+
# action
#-------
try: action = sys.argv[1]
-except: noaction = True
+except: action = ''
# With no argument, show help
-if noaction:
+if not action:
infos.tyto(target)
sys.exit(0)
# Unused argument [action]
-act_err = False
-if not action in actions:
- act_err = True
+if action in actions: act_err = False
+else: act_err = True
# target
@@ -130,6 +134,10 @@ try: target = sys.argv[2]
except: target = ''
+# option
+try: option = sys.argv[3]
+except: option = ''
+
# Set action and target for binary
def set_action():
return(action)
diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py
index 8ce9dac..c8ff824 100644
--- a/src/var/lib/tyto/program/check.py
+++ b/src/var/lib/tyto/program/check.py
@@ -878,39 +878,67 @@ def check_content(post_bottom):
), False)
+#==============================================#
+# Check if articles in servers are static Page #
+#----------------------------------------------#
+def check_static_posts():
+ global wip_static, www_static
+ wip_static = www_static = 'False'
+
+ srv_posts = \
+ [
+ (srv_post_wip_uri, 'wip_static'),
+ (srv_post_www_uri, 'www_static')
+ ]
+
+ for srv_post, static in srv_posts:
+ post_datas = open(srv_post, "r").read()
+ if not re.findall(
+ tyto.tags_html_mods[dom.wip_metas_f],
+ post_datas
+ ):
+ globals()[static] = "True"
+
+
#===============================#
# Create new article's database #
#------------------------------&co-#
def create_database():
+ # Check if article is in servers
+ check_static_posts()
+
+
# Post Configurations
#--------------------
database = \
- '# Post Configurations\n' + \
- 'post_id = "%s"\n'%db.uri_id + \
- 'post_src = "%s"\n'%db.uri_file + \
- 'post_wip = "%s"\n'%srv_post_wip_uri + \
- 'post_www = "%s"\n'%srv_post_www_uri + \
- '\n' + \
- 'direc_src = "%s"\n'%direc_src + \
- 'short_src = "%s"\n'%src_post_short_uri + \
- 'short_srv = "%s"\n'%srv_post_short_uri + \
- 'sub_uri = "%s"\n'%sub_uri + \
- 'http_wip = "%s"\n'%http_wip + \
- 'http_www = "%s"\n'%http_www + \
- '\n' + \
- 'date_chk = "%s"\n'%tyto.nowdate() + \
- 'hash_chk = "%s"\n'%db.hash_post + \
- 'date_wip = "%s"\n'%date_wip + \
- 'hash_wip = "%s"\n'%hash_wip + \
- 'date_www = "%s"\n'%date_www + \
- 'hash_www = "%s"\n'%hash_www + \
- '\n# Needed tags configurations\n' + \
+ '# Writer configurations\n' + \
'title = "%s"\n'%title + \
'about = "%s"\n'%about + \
'author = "%s"\n'%author + \
'meta_tags = "%s"\n'%tags + \
'date = "%s"\n'%date_tr + \
'snpic = "%s"\n'%snpic_url + \
+ '\n# Post Configurations\n' + \
+ 'post_id = "%s"\n'%db.uri_id + \
+ 'post_src = "%s"\n'%db.uri_file + \
+ 'direc_src = "%s"\n'%direc_src + \
+ 'short_src = "%s"\n'%src_post_short_uri + \
+ 'short_srv = "%s"\n'%srv_post_short_uri + \
+ 'sub_uri = "%s"\n'%sub_uri + \
+ 'date_chk = "%s"\n'%tyto.nowdate() + \
+ 'hash_chk = "%s"\n'%db.hash_post + \
+ '\n# wip configuration\n' + \
+ 'post_wip = "%s"\n'%srv_post_wip_uri + \
+ 'http_wip = "%s"\n'%http_wip + \
+ 'static_wip = %s\n'%wip_static + \
+ 'date_wip = "%s"\n'%date_wip + \
+ 'hash_wip = "%s"\n'%hash_wip + \
+ '\n# www configuration\n' + \
+ 'post_www = "%s"\n'%srv_post_www_uri + \
+ 'http_www = "%s"\n'%http_www + \
+ 'static_www = %s\n'%www_static + \
+ 'date_www = "%s"\n'%date_www + \
+ 'hash_www = "%s"\n'%hash_www + \
'\n# Used files\n' + \
'uris = %s'%str(files_post)
diff --git a/src/var/lib/tyto/program/db.py b/src/var/lib/tyto/program/db.py
index 5cac1b1..a488d9d 100644
--- a/src/var/lib/tyto/program/db.py
+++ b/src/var/lib/tyto/program/db.py
@@ -83,7 +83,9 @@ if args.target \
'post_id',
'post_src',
'post_wip',
+ 'static_wip',
'post_www',
+ 'static_www',
'direc_src',
'short_src',
'short_srv',
diff --git a/src/var/lib/tyto/program/dom.py b/src/var/lib/tyto/program/dom.py
index 21b8eec..df5182d 100644
--- a/src/var/lib/tyto/program/dom.py
+++ b/src/var/lib/tyto/program/dom.py
@@ -267,6 +267,27 @@ if not hole:
"footer" : footers,
"template": templates,
}
+
+ templates_wip = {
+ eval(str('wip_logo_f')),
+ eval(str('wip_css_f')),
+ eval(str('wip_navbar_f')),
+ eval(str('wip_sidebar_f')),
+ eval(str('wip_metas_f')),
+ eval(str('wip_footer_f')),
+ eval(str('wip_stats_f')),
+ }
+
+ templates_www = {
+ eval(str('www_logo_f')),
+ eval(str('www_css_f')),
+ eval(str('www_navbar_f')),
+ eval(str('www_sidebar_f')),
+ eval(str('www_metas_f')),
+ eval(str('www_footer_f')),
+ eval(str('www_stats_f')),
+ eval(str('www_rss_f'))
+ }
#====================================#
# Check if domain is ready and ready #
diff --git a/src/var/lib/tyto/program/form.py b/src/var/lib/tyto/program/form.py
index 6316e1d..b11665e 100644
--- a/src/var/lib/tyto/program/form.py
+++ b/src/var/lib/tyto/program/form.py
@@ -760,10 +760,10 @@ def create_metas(option):
'# \n' + \
- '\n' + \
- '\n' + \
- ''
+ '\n' + \
+ '\n' + \
+ '\n' + \
+ ''
tyto.set_file(dom.metas_f, 'New', metas_tags)
@@ -966,11 +966,11 @@ def create_footer(option):
footer_laws_links = ''
if footer_laws:
footer_laws_links = \
- ' %s%s \n'%(
+ ' %s%s \n'%(
langs.site.read, langs.site.pp
) + \
' %s\n'%footer_laws + \
- ' \n'
+ ' \n'
# Set default content for
# navbar config file
@@ -1000,41 +1000,43 @@ def create_footer(option):
footer = \
'%s\n'%footer_lang%(tyto.Tyto, dom.footer_f) + \
'