Conversation
…h thumbnails (#35) Re-shape the Playground demo into a multi-feed showcase that exercises the public spec primitives (sub-query, when-block, post_term_meta, trash + N-day window) and produces a visually rich result. Layout: - playground/blueprint.json orchestrates the seeds; landing page is now /wp-admin/edit.php?post_type=feedwright_feed (the feed list) - playground/assets/*.png PNG logos rendered from assets/*.svg via Playwright/Chromium; used by SmartNews snf:logo and snf:darkModeLogo - playground/seeds/posts.xml 30-post fixture: 6 per category across News / Tech / Lifestyle / Sports / Business, 2 marked status='trash' to demonstrate <mdf:deleted/> end-to-end. Each post carries an Unsplash image_id attribute used both as featured image and as a top-of-body figure - playground/seeds/seed-helpers.php shared block-markup builders - playground/seeds/seed-shared.php parses posts.xml, sets up taxonomy terms (with mediba category-ID term meta), creates the admin profile, sideloads each Unsplash image, sets it as featured, and embeds it at the top of post_content - playground/seeds/seed-{goonews,mediba,smartnews}.php build the three feedwright_feed posts Old single playground/seed.php deleted (was a one-off SmartNews demo).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #35.
Summary
Playground demo を 複数アグリゲータプリセットの showcase に再構成。30 件のリアルなサンプル投稿と Unsplash 画像を全自動でセットアップし、起動直後にフィード一覧から各仕様の出力を確認できる。
Changes
Layout
playground/seed.php(単一 SmartNews demo)は削除。blueprint.json
landingPageを/wp-admin/edit.php?post_type=feedwright_feed(フィード一覧)に変更writeFile + wp-cliで順次実行(helpers → shared → goonews → mediba → smartnews)posts.xml の 30 投稿
photo-{ID}をimage_id属性で紐付けstatus="trash"(mediba<mdf:deleted/>のデモ用)<terms>ブロックに mediba カテゴリ ID も含めて 1 ファイルで完結seed-shared.php
wp_insert_postwp_set_post_terms(カテゴリ + タグ)https://images.unsplash.com/{photo_id}?w=1200&q=80&fit=crop) をdownload_url+media_handle_sideloadでメディアライブラリ取り込みset_post_thumbnail(アイキャッチ)<figure>を post_content の先頭に注入wp_trash_post_mediba_category_idを term meta として設定SmartNews seed
snf:logo/snf:darkModeLogoの URL はplayground/assets/logo-horizontal.pngをraw.githubusercontent.com経由で参照mediba seed
<mdf:deleted/>を trash 投稿だけに、それ以外は通常要素をfeedwright/whenの negate で出し分け<category>はpost_term_meta.category._mediba_category_idで解決postStatus = ['publish', 'trash']+trashWithinDays = 7で削除窓を制御goonews seed
<smp:relation>をfeedwright/sub-query(taxonomy mode、最大 3)で展開Test plan
https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/mt8/feedwright/main/playground/blueprint.jsonを開いて、ランディングがフィード一覧、3 フィード(goonews / mediba / smartnews)が公開状態/wp-admin/edit.phpの一覧で thumbnail 列に画像が見える<figure>で同じ画像が表示される<smp:relation>(同カテゴリ siblings)<mdf:deleted/>のみ、publish は通常要素一式、<category>がカテゴリの mediba ID(91 / 101 / 201 / 202 / 503)に解決<snf:logo>/<snf:darkModeLogo>に Feedwright のロゴ PNG URL、<media:thumbnail>に sideload された画像 URLphp -l通過影響範囲
playground/ 配下のみ。プラグイン本体・テスト・docs に影響なし。