[1.11.0] - '! LOGO' mark

This commit is contained in:
Cyrille L 2024-01-06 02:00:46 +01:00
parent 83e8f5eab3
commit b001efcd9a
12 changed files with 46 additions and 9 deletions

View File

@ -8,6 +8,11 @@ Tyto - Littérateur
# CURRENTLY IN DEV (in devel branch) !
## [1.11.0]
- added "! LOGO" mark in article header
- - create HTML logo image in <article> > <header>
- fix: typos (HTML and translations)
## [1.10.0]
- added management of optional footer_about.html file created by user (see [help modules])

2
debian/control vendored
View File

@ -1,5 +1,5 @@
Package: tyto
Version: 1.10.0
Version: 1.11.0
Section: custom
Priority: optional
Architecture: all

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# version: 1.10.0
# date: 2024/01/04 17:18:36
# version: 1.11.0
# date: 2024-01-06 01:54:236
# Tyto - Littérateur
# Copyright (C) 2023 Cyrille Louarn <echolib+tyto@a-lec.org>

View File

@ -146,7 +146,7 @@ def header_sl_tags():
# Set needed tags
for ln, line in enumerate(article_header, 1):
# Options_marks (! NOMAP, ! NOTSS, ! TOC, ...)
# Options_marks (! NOMAP, ! NORSS, ! TOC, .! LOGO..)
for mark in post.options_marks:
if not post.options_marks[mark] \
and line.lstrip().startswith(mark):

View File

@ -39,6 +39,9 @@ def create():
# Create specific article metas tags
post_metas = article_metas()
# Include article logo (if "! LOGO" mark in metas header)
post_logo = include_logo()
# Create references in div
post_refs = article_refs()
@ -57,6 +60,8 @@ def create():
nginx_mods%"navbar",
# <time>
pub_date,
# LOGO
post_logo,
# h1 Main Title link
post.datas["www_url"],
post.needed_tags["title"], post.needed_tags["authors"], local_date,
@ -114,6 +119,21 @@ def article_metas():
return post_metas
#==========================================#
# Add article logo in <article> > <header> #
# Only if "! LOGO" mark exists #
#------------------------------------------#
def include_logo():
post_logo = ""
if post.options_marks["! LOGO"]:
post_logo = '<img id="article_logo" src="%s" alt="%s">'%(
post.needed_tags["logo"],
post.needed_tags["title"],
)
return post_logo
#========================================#
# Create div inclding article references #
# In template, is put under main title #
@ -159,6 +179,7 @@ template = """<!-- %s - %s (page generated by Tyto - Littérateur) -->
<article id="article">
<time datetime="%s">
<header id="article_header">
%s
<h1 id="article_title">
<a id="article_title_link" href="%s" title="%s -- %s, %s">%s</a>
</h1>

View File

@ -204,6 +204,7 @@ def set_default_vars():
"! NOMAP" : False,
"! NORSS" : False,
"! TOC" : False,
"! LOGO" : False,
}
# Tags that must be set in header

View File

@ -724,7 +724,7 @@ def bcodes():
'<ol class="%s_items">\n'%css + \
"%s\n"%bcode + \
"</ol>" + \
"<pre>"
"</pre>"
replace_article(post.block_tags["bcodes"]["sources"][nbr][1], bcode)

View File

@ -19,6 +19,7 @@ main#article_aside {}
*/
article#article {}
header#article_header {}
img#article_logo {}
h1#article_title {}
a#article_title_link {}
div#article_refs {}

View File

@ -614,7 +614,7 @@ authors: Author1,author2
# All these markers are optional
# ----------
# If not set, article log is domain logo image
# If not set, article logo is domain logo image
logo: URI
%s
@ -634,6 +634,11 @@ logo: URI
# Marker to NOT include article in RSS/feed
! NORSS
# Add article logo
# If not set, show domain logo
! LOGO
# Separator
-----

View File

@ -626,7 +626,7 @@ authors: Auteur1,auteur2
# Tous les marqueurs suivants sont optionnels
# ----------
# Si non renseigné, le logo de l'article sera celui du site
# Si non renseigné, le logo de l'article sera celui du domaine
logo: URI
%s
@ -646,6 +646,10 @@ logo: URI
# Marqueur pour NE PAS inclure l'article dans le flux RSS
! NORSS
# Ajouter le logo de l'article
# Si logo: n'est pas défini, affiche le logo du domaine
! LOGO
# Séparateur
-----

View File

@ -51,7 +51,7 @@ terms_title = "%s of"%terms
bylaws = "Bylaws"
bylaws_title = "%s of"%bylaws
feed_rss = "RSS feed 2.0"
generated_by = "Generated by"
generated_by = "generated by"
off_website = "Official website"
about = "About"
tyto_credit = "Website %s"%generated_by

View File

@ -51,7 +51,7 @@ terms_title = "%s de"%terms
bylaws = "Statuts"
bylaws_title = "%s de"%bylaws
feed_rss = "Flux RSS 2.0"
generated_by = "Géneré par"
generated_by = "géneré par"
off_website = "Site web officiel"
about = "À propos de"
tyto_credit = "Site web %s"%generated_by