Utilise maintenant Zola v0.23.1

This commit is contained in:
julien
2026-08-06 20:23:55 +02:00
parent 1767245f10
commit d7b8aeab93
30 changed files with 759 additions and 1170 deletions
+1
View File
@@ -71,6 +71,7 @@ SECTION_FIELDS = {
}
LIST_FIELDS = frozenset({"logograms", "lectures", "themes", "genres"})
URL_TERM_FIELDS = frozenset({"themes", "genres"})
CONTENT_SECTIONS = frozenset(SECTION_FIELDS) | {"vocabulaire"}
UPDATED_LINE_RE = re.compile(r"(?m)^(?:#\s*)?updated\s*=.*?(?=\r?$)")
+13 -2
View File
@@ -12,6 +12,7 @@ from _schema import (
LIST_FIELDS,
SECTION_FIELDS,
UPDATED_LINE_RE,
URL_TERM_FIELDS,
VOCABULARY_FIELDS,
)
@@ -26,7 +27,6 @@ COMMON_FIELDS = {
}
class Validator:
def __init__(self) -> None:
self.errors = 0
@@ -118,7 +118,18 @@ def check_fields(
label = f"{table_name}.{field}"
if field in LIST_FIELDS:
check_string_list(table[field], label, path, validator)
if check_string_list(table[field], label, path, validator) and field in URL_TERM_FIELDS:
spaced_terms = [
term
for term in table[field]
if any(char.isspace() for char in term)
]
if spaced_terms:
validator.error(
path,
f"{label} doit utiliser des tirets à la place des espaces : "
+ ", ".join(repr(term) for term in spaced_terms),
)
else:
check_type(table[field], str, label, path, validator)