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

オープン
#235 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
backend

調査の方向性

まず、参照フィールドが contentDirPath を基準にパスをどのように解決するかを追跡します。保存された slug をドキュメントのパスにマッピングするために必要な設定エントリポイントを定義します。これには collection フォルダーと拡張子の動作を含めます。"my-tag" のような参照値が "tags/my-tag.yml" のようなパスに解決されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

feature needs-research pkg/source-files

currently, reference fields 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 (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)

主要言語
TypeScript
スター
3.5k
フォーク
192
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

contentlayerdev/contentlayer のほかの issue

contentlayerdev/contentlayer の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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