Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add github in sources #1946

Merged
merged 3 commits into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/content/4.api/3.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The watcher is a development feature and will not be included in production.

Define different sources for contents.

Contents can be located in multiple places, in multiple directories, or in remote git repositories.
Contents can be located in multiple places, in multiple directories, or in remote git repositories thanks to [`unstorage`](https://unstorage.unjs.io/).

```ts [nuxt.config.ts]
export default defineNuxtConfig({
Expand All @@ -99,7 +99,15 @@ export default defineNuxtConfig({
driver: 'fs',
// ...driverOptions
base: resolve(__dirname, 'content-fa') // Path for source directory
}
},
github: {
prefix: '/blog', // Prefix for routes used to query contents
driver: 'github', // Driver used to fetch contents (view unstorage documentation)
repo: "<owner>/<repo>",
branch: "main",
dir: "content", // Directory where contents are located. It could be a subdirectory of the repository.
// Imagine you have a blog inside your content folder. You can set this option to `content/blog` with the prefix option to `/blog` to avoid conflicts with local files.
},
}
}
})
Expand Down