contentlayerdev / contentlayerdev/contentlayer

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

Abierto
#235 0 comentarios 1 reacción 0 asignados Ver en GitHub
feature needs-research pkg/source-files
Lenguaje dominante
TypeScript
Estrellas
3.5k
Forks
192
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.