ResourcesBySelector 组件允许您根据 pcx_content_type 和 products frontmatter 属性引入文档资源。
import { ResourcesBySelector } from "~/components";
<ResourcesBySelector
directory="workers/examples/"
types={["example"]}
filterables={["products"]}
/>directorystring要在其中搜索资源的目录,相对于
src/content/docs/。例如,对于 Workers 教程,directory="workers/tutorials/"。filterablesstring[]要在前端过滤器下拉列表中显示的 frontmatter 属性数组。例如,
filterables={["products"]}将允许用户根据每个页面的productsfrontmatter 进行过滤。typesstring[]用于过滤哪些内容被引入该组件的
pcx_content_type值数组。例如,types={["example"]}。productsstring[]optional用于过滤哪些内容被引入该组件的
products值数组。例如,products={["D1"]}。showDescriptionsbooleanoptional (default true)如果设置为
false,将仅显示相关页面的标题,而不显示描述。showLastUpdatedbooleanoptional (default false)如果设置为
true,将添加最后更新日期,该日期是在updatedfrontmatter 值中添加的。