Artikel 15-17, 22-24, 27-28; H1 in der Score-Bewertung

This commit is contained in:
2026-09-22 14:38:02 +02:00
parent 28912cf493
commit afc132f7b8
4 changed files with 106 additions and 85 deletions

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""Lokaler NeuronWriter-Score, identischer Pruefkoerper wie WF2 (Kurzantwort + Inhalt + FAQ).
"""Lokaler NeuronWriter-Score, identischer Pruefkoerper wie WF2 (H1 + Kurzantwort + Inhalt + FAQ).
Aufruf: python3 build/nw_score.py artikel/artikel-SLUG.json [...]"""
import json, os, sys, urllib.request
@@ -15,7 +15,7 @@ E = env()
for pfad in sys.argv[1:]:
a = json.load(open(pfad, encoding='utf-8'))
faq = '\n'.join(f"<h3>{f.get('frage','')}</h3><p>{f.get('antwort','')}</p>" for f in a.get('faq') or [])
html = '\n'.join([f"<p>{a['kurzantwort']}</p>" if a.get('kurzantwort') else '', a['content_html'],
html = '\n'.join([f"<h1>{a['titel']}</h1>", f"<p>{a['kurzantwort']}</p>" if a.get('kurzantwort') else '', a['content_html'],
f"<h2>{a.get('faq_ueberschrift') or 'Häufige Fragen'}</h2>\n{faq}" if faq else ''])
body = json.dumps({'query': a['query_id'], 'html': html, 'title': a.get('seo_titel') or a['titel'],
'description': a.get('seo_beschreibung', '')}).encode()