next-markdown
is able to pull your markdown files from another git repository.
For that, set the contentGitRepo
param in the next-markdown
initializer where you can specify:
remoteUrl
: the git remote URL, eg. https://github.com/name/project.gitbranch
: the branch, eg. main
Remember that pathToContent will be relative to the root of the git repo.
const nextmd = NextMarkdown({
pathToContent: "./",
contentGitRepo: {
remoteUrl: "https://github.com/name/project.git",
branch: "main"
}
});
- to separate your content from your app
- to avoid tons of commits like
Update about.md
orUpdate 2021-07-15-keep-your-project-minimalist.md
, etc. in your app git - and maybe a lot more reasons (opened for suggestions 🙂)
git clone https://github.com/frouo/next-markdown.git
cd next-markdown
npm install
npm run build
cd examples/remote-content/
npm install
npm run dev