Skip to content

Playground demo を per-aggregator seed 構造に再編成し、3 ニュースフィード(goo / mediba / SmartNews)をプリセット #35

@mt8

Description

@mt8

背景

現在の playground/seed.php は 1 個のフィード(SmartNews 風)だけを作る単一スクリプト。.docs/ で公式仕様を整理した今、Playground は 複数の公開仕様プリセットを並べる showcase として再構成したい。

期待

  1. playground/seed-{format}.php の per-aggregator 構造に分割
  2. blueprint.json から各 seed を順次 wp eval-file で実行
  3. 全フィードを post_status=publish で作成
  4. ランディングページを フィード一覧 (/wp-admin/edit.php?post_type=feedwright_feed) に変更

実装内容

新規ファイル

  • playground/seed-helpers.php — ブロックマークアップ生成のグローバル関数群(feedwright_pg_el / feedwright_pg_bind / feedwright_pg_cdata / feedwright_pg_when / feedwright_pg_sub_query / feedwright_pg_insert_feed 等)
  • playground/seed-shared.php — オプション・カテゴリ・term meta(_mediba_category_id)・サンプル投稿 6 本(5 カテゴリ網羅)・admin プロファイルのブートストラップ
  • playground/seed-goonews.php — goo / dmenu 共通仕様(goonews: smp: namespace、smp:relation を sub-query で展開)
  • playground/seed-mediba.php — mediba mdf: namespace、feedwright/when<mdf:deleted/> を trash 投稿だけに出す、post_term_meta.category._mediba_category_id でカテゴリ ID 解決、postStatus=[publish, trash] + trashWithinDays=7
  • playground/seed-smartnews.php — SmartFormat(snf: media: dc: content: namespace、snf:logo / snf:darkModeLogomedia:status を post_status から map)

削除

  • playground/seed.php(単一スクリプト、上記分割で置換)

blueprint.json

  • landingPage/wp-admin/edit.php?post_type=feedwright_feed に変更
  • 各 seed を writeFile + wp-cli ステップで順番に実行

受け入れ基準

  • Playground 起動後、/wp-admin/edit.php?post_type=feedwright_feed にランディング、3 フィード(goonews / mediba / smartnews)が公開状態で表示
  • 各フィード URL(例:/feedwright/goonews/)で正しい XML が返る
  • mediba フィードでは trash した投稿の item が <mdf:deleted/> だけになる、publish 投稿は通常の elements 一式が出る
  • mediba <category> がカテゴリの term meta _mediba_category_id から正しく解決される(テクノロジー=202、News=101、コネタ=91 等)
  • goo フィードで各 item に最大 3 件の <smp:relation> が出る(同じカテゴリの他記事)
  • PHP lint OK

影響範囲

  • playground/ 配下のみ。プラグイン本体・テスト・docs に影響なし
  • 翻訳ファイル更新不要(playground は demo 配信用、出力に翻訳文字列を含まない)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions