Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

セレクター別リソース

最終更新 Markdown で表示Agent セットアップ

ResourcesBySelector コンポーネントは、frontmatter の pcx_content_typeproducts プロパティに基づいて、ドキュメントのリソースを取り込みます。

コンポーネント

import { ResourcesBySelector } from "~/components";

<ResourcesBySelector
	directory="workers/examples/"
	types={["example"]}
	filterables={["products"]}
/>

入力

  • directory string

    src/content/docs/ からの相対パスで、リソースを探すディレクトリです。たとえば Workers のチュートリアルなら directory="workers/tutorials/" です。

  • filterables string[]

    フロントエンドのフィルタードロップダウンに表示する frontmatter プロパティの配列です。たとえば filterables={["products"]} とすると、各ページの products frontmatter で絞り込めます。

  • types string[]

    コンポーネントに取り込むコンテンツを絞り込む pcx_content_type 値の配列です。たとえば types={["example"]} です。

  • products string[] 任意

    コンポーネントに取り込むコンテンツを絞り込む products 値の配列です。たとえば products={["D1"]} です。

  • showDescriptions boolean 任意(デフォルト true)

    false にすると、関連ページのタイトルだけを表示し、説明文は表示しません。

  • showLastUpdated boolean 任意(デフォルト false)

    true にすると、最終更新日を追加します。日付は updated frontmatter 値 で設定します。

役に立ちましたか?