13 lines
595 B
Python
13 lines
595 B
Python
# -*- coding: utf-8 -*-
|
|
"""Schreibt einen Artikel aus einer Python-Datei mit dict A und prueft ihn. Aufruf: python3 build/artikel_schreiben.py datei.py"""
|
|
import json, subprocess, sys
|
|
ns = {}
|
|
exec(open(sys.argv[1], encoding='utf-8').read(), ns)
|
|
a = ns['A']
|
|
a.setdefault('stand_datum', '2026-09-22')
|
|
pfad = f"artikel/artikel-{a['slug']}.json"
|
|
json.dump(a, open(pfad, 'w', encoding='utf-8'), ensure_ascii=False, indent=2)
|
|
print('SEO', len(a['seo_titel']), len(a['seo_beschreibung']))
|
|
subprocess.run(['python3', 'build/pruef_lokal.py', pfad])
|
|
subprocess.run(['python3', 'build/nw_score.py', pfad])
|