contentlayerdev / contentlayerdev/contentlayer

allow to configure how `reference` field values resolves to file paths

オープン
#235 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
feature needs-research pkg/source-files
主要言語
TypeScript
スター
3.5k
フォーク
192
PR マージ指標
30日以内にマージされた PR はありません

説明

currently, [`reference` fields](https://www.contentlayer.dev/docs/reference/source-files/field-types#reference) expect a path to another document file, relative to `contentDirPath`. it would be great if we could configure how a reference field value resolves to the relative file path.

in my case, i am using "Netlify CMS", which also has a similar concept of [`relation` fields](https://www.netlifycms.org/docs/widgets/#relation) (and saves to markdown/yaml). however, it will only save the `slug` as field value, and use the `folder` and `extension` of a `collection` to construct file paths. e.g. it will save `"my-tag"` as relation field value, to reference a document in `"tags/my-tag.yml"` (when the `tags` collection has `folder: "tags", extension: "yml"` configured)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。