Skip to content

Commit

Permalink
fix: use github.releases to fetch releases (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz authored Jun 22, 2021
1 parent 4137f43 commit 09307a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/content/1.get-started/2.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ export default {
| `github.repo` | `String` | Your project repository. |
| `github.branch` | `String` | The branch to link. |
| `github.dir` | `String` | The directory in which Docus lives in that repository. |
| `github.releases` | `Boolean` | If set to true, Docus will fetch Github releases. |
| `github.releases` | `Boolean\|String` | If set to true, Docus will fetch Github releases. If set to a string, Docus will use it as the target repository to fetch releases. |
| `github.url` | `String` | The root URL of GitHub. (set by default) |
| `github.apiUrl` | `String` | The API URL of GitHub. (set by default) |
4 changes: 2 additions & 2 deletions nuxtjs.org/docus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export default {
indexName: 'docus'
},
github: {
repo: 'nuxt/nuxt.js',
repo: 'nuxt/nuxtjs.org',
branch: 'dev',
releases: true
releases: 'nuxt/nuxt.js'
},
theme: {
header: {
Expand Down
4 changes: 2 additions & 2 deletions src/github/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export async function fetch(settings: GithubReleaseOptions) {
const getMajorVersion = (r: GithubRelease): number => (r.name ? Number(r.name.substring(1, 2)) : 0)

if (settings.releases && settings.repo) {
const { apiUrl, repo } = settings
const { apiUrl, repo, releases: releasesRepo } = settings
const girhubReleases = await fetchGitHubReleases({
apiUrl,
repo,
repo: typeof releasesRepo === 'string' ? releasesRepo : repo,
token: process.env.GITHUB_TOKEN || ''
})
releases = await Promise.all(
Expand Down

1 comment on commit 09307a7

@vercel
Copy link

@vercel vercel bot commented on 09307a7 Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.