zce / velite

Turns Markdown / MDX, YAML, JSON, or others into app's data layer with Zod schema.
http://velite.js.org
MIT License
341 stars 19 forks source link

Is it possible to use files stored inside github repo? #130

Open AuJezus opened 2 months ago

AuJezus commented 2 months ago

Hello, I really like velite, it's a great project so please keep working on it :).

I would like to store my files on github repo, so I could use this as hosting for my .mdx files and each website that will consume these files will be able to pass it's own react components to render to html.

I know it's possible to get files from github using contentLayer, but I would like to use velite.

zce commented 2 months ago

Currently, Velite does not support remote content sources.

You can consider using git submodule with automated workflows to implement it.

AuJezus commented 2 months ago

Thank you, I will try to do that.

returnkirbo commented 2 months ago

Currently, Velite does not support remote content sources.

You can consider using git submodule with automated workflows to implement it.

Will Velite supporting remote content sources be an expected feature in the later future?

zce commented 2 months ago

At present, we can only say that it is possible,

The current consideration is to implement it through a custom loader.

Although the loader architecture is not designed to support this.

maybe future:

import { defineLoader } from 'velite'

export default defineLoader({
  // name: 'json',
  test: /^http\:\/\//,
  load: pattern => {
    // fetch data from remote
    return new VFile({ ... })
  }
})