Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/robithadani/okf-publisher/archive/refs/heads/main.zipPlugin WordPress yang mengekspor konten situs menjadi bundle Open Knowledge Format v0.1 — direktori markdown + YAML frontmatter yang bisa dibaca aplikasi/agent AI mana pun.
Instalasi
- Salin folder
okf-publisher/kewp-content/plugins/, lalu aktifkan. - Buka Settings → OKF: pilih post type & taksonomi, isi deskripsi situs, simpan.
- Klik Rebuild Sekarang (atau
wp okf rebuilduntuk situs besar). - Bundle tersaji di
https://situs.com/okf/index.md.
Setelah build awal, bundle ter-update otomatis setiap kali konten disimpan, di-unpublish, atau dihapus.
Konsumsi oleh aplikasi AI
Beri aplikasi AI klien satu URL: https://situs.com/okf/index.md. Agent membaca index, lalu menelusuri link markdown antar-dokumen. Bila API key diisi di setting, konsumen wajib mengirim header X-OKF-Key: <key>.
Discoverability (opsional)
Centang Tayangkan /llms.txt di setting untuk menyajikan https://situs.com/llms.txt berisi penunjuk ke bundle OKF, agar agent pihak ketiga menemukannya. Hanya berlaku bila bundle publik (API key kosong); jangan aktifkan bila plugin SEO lain sudah menyajikan llms.txt.
Perintah WP-CLI
wp okf rebuild # bangun ulang seluruh bundle
wp okf validate # cek setiap file punya frontmatter + field `type` (jalankan setelah rebuild sebagai smoke test)
Hook untuk developer
// Ubah/tambah field frontmatter (mis. dari ACF)
add_filter( 'okf_frontmatter', fn( array $fm, WP_Post $post ) => $fm, 10, 2 );
// Kecualikan post tertentu dari bundle
add_filter( 'okf_exclude_post', fn( bool $exclude, WP_Post $post ) => $exclude, 10, 2 );
Catatan teknis
- File fisik ditulis ke
wp-content/uploads/okf/; URL/okf/*disajikan lewat rewrite rule + loader tipis (portabel untuk Apache & nginx, sekaligus menangani API key). - Konversi HTML → Markdown memakai
DOMDocumentbawaan PHP — tanpa Composer. Bila butuh fidelitas lebih, gantiOKF_Markdowndenganleague/html-to-markdown. - Hanya konten berstatus
publishyang pernah masuk bundle.