@sse-ui/nu-github
v1.0.1
Published
> GitHub integration for [Nuxt](https://v3.nuxtjs.org) & [Content](https://content.nuxtjs.org)
Downloads
2
Readme
Github Module
Setup
Install @sse-ui/nu-github
in your project:
# Using Yarn
yarn add --dev @sse-ui/nu-github
# Using NPM
npm install --save-dev @sse-ui/nu-github
# Using PNPM
pnpm add --save-dev @sse-ui/nu-github
Then, add @sse-ui/nu-github
to the modules
section of your nuxt.config.ts
:
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
modules: [
'@nuxt/content', // Required
'@sse-ui/nu-github'
],
sseGithub: {
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
sseGithub: {
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
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Generate type stubs using
yarn prepare
ornpm run prepare
- In
playground/.env
, add your personal access token
GITHUB_TOKEN='<your-personal-token>'
- Launch playground using
yarn dev
ornpm run dev