@docus/github
GitHub integration for Nuxt & Content
2,523
| Install | |
|---|---|
npm install @docus/github |
|
| Latest Version: | 1.2.6 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | May 6, 2022 |
| Links: | npm |
Maintainer: alexchopin
Github Module
Setup
Install @docus/github in your project:
# Using Yarn
yarn add --dev @docus/github
# Using NPM
npm install --save-dev @docus/github
Then, add @docus/github to the modules section of your nuxt.config.ts:
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
modules: [
'@nuxt/content', // Required
'@docus/github'
],
github: {
repo: 'nuxt/framework' // Or use GITHUB_REPO in .env
}
})
Lastly, create a personal access token on GitHub and add it into your .env:
GITHUB_TOKEN='<your-personal-token>'
Usage
<script setup lang="ts">
const { data: releases } = await useAsyncData('releases', () => githubReleases())
</script>
<template>
<div>
<div v-for="release in releases" :key="release.name">
<ProseH2 :id="release.name">{{ release.name }}</ProseH2>
<Content :document="release" />
</div>
</div>
</template>
Options
github: {
repo: string,
releases: false | {
api: string
repo: string
token: string
/**
* Parse release notes markdown and return AST tree
*
* Note: This option is only available when you have `@nuxt/content` installed in your project.
*
* @default true
*/
parse: boolean
}
}
Development
- Run
npm run dev:prepareto generate type stubs. - Create a personal access token on GitHub and add it into
playground/.env
GITHUB_TOKEN='<your-personal-token>'
- Use
npm run devto start playground in development mode.
Related Packages
@docus/github-edge
4,966
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.2.6 | ^3.0 | MIT | |
| 1.2.5 | ^3.0 | MIT | |
| 1.2.4 | ^3.0 | MIT | |
| 1.2.2 | ^3.0 | MIT | |
| 1.0.4 | MIT | ||
| 1.0.3 | MIT |