contentlayerdev / contentlayerdev/contentlayer

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

Đang mở
#235 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
feature needs-research pkg/source-files
Ngôn ngữ chính
TypeScript
Star
3.5k
Fork
192
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.