Commit graph

18 commits

Author SHA1 Message Date
fbd4745afb a 2025-11-05 06:25:26 +01:00
a931ff9ace Docs: Add filter examples to QUICKSTART.md
- Added --filter option examples for repository imports
- Included practical filter patterns (posts/*/index.md, etc.)
- Removed experimental warning as feature is now tested
- Added real-world example with FOERBICO repository
2025-11-05 06:12:34 +01:00
86717185c4 Feature: Add path filter for Forgejo repository imports
- Added path_filter parameter to fetch_forgejo_repo_markdown_files()
- Filter supports wildcard patterns (e.g., 'posts/*/index.md')
- Fixed hardcoded base URL - now detects git.rpi-virtuell.de and other instances
- Added --filter command line option for repo mode
- Updated help text with filter examples
- Enables selective import of specific markdown files from repository

Usage: python workflow.py --repo <URL> [branch] --filter 'Website/content/posts/*/index.md'
Example: Imports only index.md files from posts subdirectories (59 files found)
2025-11-05 06:11:15 +01:00
98d7244e9d Change default post status from 'draft' to 'publish'
- Changed default_status in direct URL mode from 'draft' to 'publish'
- Changed default_status in Forgejo repository mode from 'draft' to 'publish'
- Changed fallback in status determination from 'draft' to 'publish'
- Posts without creativeWorkStatus in frontmatter will now be published immediately
- Can still be overridden by setting creativeWorkStatus in frontmatter or status in YAML config
2025-11-05 06:02:31 +01:00
fb9720fb2a Feature: Update existing posts instead of skipping
- Added update_post() method to WordPress API client
- Added _put() method for HTTP PUT requests
- Modified create_post() to call update_post() when duplicate is found
- Existing posts now get updated with latest content, tags, categories, dates, etc.
- Prevents manual deletion and re-creation workflow
- Added excerpt as explicit parameter to create_post()
- Debug output shows 'Aktualisiere...' message when updating

Example: Re-running import on existing post now updates all fields including newly added author tags
2025-11-05 05:45:24 +01:00
aa50145633 Fix: Support multiple authors as tags
- Previously only first author from list was converted to tag
- Now collects all authors from all sources (author, #staticSiteGenerator.author, #commonMetadata.creator)
- Handles both single authors and author lists
- Removes duplicates if same author appears in multiple sources
- All authors are added as individual tags in Vorname_Nachname format
- Example: ['Florian Mayrhofer', 'Gina Buchwald-Chassée'] → tags 'Florian_Mayrhofer', 'Gina_Buchwald-Chassée'
2025-11-05 05:40:46 +01:00
85f58e2528 Feature: Map authors as tags in Vorname_Nachname format
- Added format_author_as_tag() function to convert author names to tag format
- Author names automatically added to tags with spaces replaced by underscores
- Example: 'Jörg Lohrer' → 'Jörg_Lohrer' tag
- Enables author filtering via WordPress tag taxonomy
- Updated documentation to reflect new author handling approach
- Version bump to 0.3.0
2025-11-05 05:32:20 +01:00
141b847e97 Docs: Bekannte Einschränkungen dokumentieren
Hinzugefügt in README.md (prominent am Anfang):
- ⚠️ Bekannte Einschränkungen-Sektion
- Autor-Zuordnung: Aktuell nur zum importierenden User
- Forgejo-Batch: Noch nicht ausreichend getestet
- Empfehlung: Start mit einzelnen URLs

Aktualisiert in QUICKSTART.md:
- Hinweis auf Autor-Zuordnung
- Modus 3 (Forgejo) als 'Experimentell' markiert
- Empfehlung für Modus 1 (einzelne URL) hervorgehoben

Erweitert in CHANGELOG.md:
- Geplante Features nach Priorität sortiert
- Autor-Mapping als Hoch-Priorität
- Robuste Forgejo-API als Hoch-Priorität
- Neue Features: Dry-Run-Modus, Mehrsprachigkeit
2025-10-01 10:22:32 +02:00
e0bcf215ab Update CHANGELOG.md for v0.2.2 2025-10-01 09:50:18 +02:00
4bac1ad597 Fix: term_exists Fehler - Nutze term_id aus WordPress-Fehlerantwort
Problem:
- Tags/Kategorien wurden als existierend erkannt, aber nicht dem Beitrag zugewiesen
- WordPress-API gibt bei 'term_exists'-Fehler die term_id in den Fehler-Daten zurück
- Diese term_id wurde nicht genutzt, stattdessen wurde nur erneut gesucht

Lösung:
- Extrahiere term_id direkt aus error_data['data']['term_id']
- Bei term_exists-Code: Nutze die zurückgegebene term_id
- Fallback: Suche erneut falls Extraktion fehlschlägt
- Gezielte Suche mit 'search'-Parameter für bessere Performance

Verbesserungen:
- get_tags() und get_categories() mit optionalem search-Parameter
- Debug-Ausgaben: '→ Tag gefunden' statt nur bei Erstellung
- Reduziert API-Calls durch gezielte Suche

Expected Output:
Tags aus Frontmatter: ['OER', 'OEP', ...]
  → Tag 'OER' gefunden (ID: 3866)
  → Tag 'OEP' existiert bereits (ID: 3867)
Gesamt Tag-IDs: [3866, 3867, ...]
2025-10-01 09:49:50 +02:00
74cb36b127 Update CHANGELOG.md for v0.2.1 2025-10-01 09:23:09 +02:00
99a4a9408f Fix: Frontmatter mit Hash-Kommentaren und Debug-Ausgaben
Fixes:
- Unterstützung für flaches Frontmatter (wenn #commonMetadata: als Kommentar)
- creativeWorkStatus direkt im Frontmatter wird jetzt erkannt
- datePublished direkt im Frontmatter wird jetzt erkannt
- Status 'Published' wird zu 'publish' konvertiert (mit 'publish' in lowercase)
- date_gmt für explizite Datumskontrolle hinzugefügt

Debug-Ausgaben:
- Tag-Verarbeitung: Zeigt gefundene Tags und IDs
- Post-Erstellung: Zeigt gesendete Daten (Tags, Kategorien, Datum)
- WordPress-Response: Zeigt zurückgegebene Tags und Datum
- Verbesserte Erfolgsmeldung mit 

Getestet mit content/beispiel-beitrag.md:
 Status: publish
 Datum: 2025-09-02
 Tags: 6 Stück korrekt extrahiert
2025-10-01 09:22:33 +02:00
c269105cd0 Add CHANGELOG.md 2025-10-01 08:30:52 +02:00
9ba1aa7b10 Bugfix: Tag-Duplikate, Post-Duplikate und Veröffentlichungsdatum
Fixes:
- Tag/Kategorie-Erstellung: Bessere Fehlerbehandlung für bereits existierende Tags
- Post-Duplikatsprüfung: Verbesserte Suche mit status='any' und case-insensitive Vergleich
- Veröffentlichungsdatum: datePublished aus Frontmatter wird als WordPress-Datum gesetzt
- Erweiterte Datumsextraktion aus verschiedenen Frontmatter-Strukturen

Neue Datei:
- USAGE_MODES.md: Übersicht der drei Verwendungsmodi
2025-10-01 08:30:07 +02:00
7a234be652 Feature: Automatische Metadaten-Extraktion aus Frontmatter
- Neuer markdown_parser.py mit YAML-Frontmatter Extraktion
- Unterstützung für drei Modi: Einzelne URL, YAML-Batch, Forgejo-Repo
- Metadaten (name, description, tags, image, author) aus Frontmatter
- Schema.org-Support für commonMetadata
- Vereinfachte posts.yaml (nur URLs statt vollständiger Metadaten)
- Aktualisierte Dokumentation (README.md, QUICKSTART.md)
- Beispiel-Beitrag mit vollständigem Frontmatter
2025-10-01 08:10:09 +02:00
e3b19bb0df venv anleitung 2025-10-01 06:28:35 +02:00
dc5113d303 Add QUICKSTART guide and .gitattributes 2025-10-01 06:17:58 +02:00
5f923d8ece Initial commit: WordPress News Import System 2025-10-01 06:16:10 +02:00