feat: fetching docs from github

This commit is contained in:
wonderlandpark 2021-05-18 10:20:06 +09:00
parent 9b4935f015
commit 07d56c0db0
4 changed files with 85 additions and 194 deletions

View File

@ -1,91 +1,37 @@
import { NextPage } from 'next'
import { GetStaticProps, NextPage } from 'next'
import dynamic from 'next/dynamic'
const Docs = dynamic(()=> import('@components/Docs'))
import { SpecialEndPoints } from '@utils/Constants'
const Privacy: NextPage = () => {
const Docs = dynamic(()=> import('@components/Docs'))
const Markdown = dynamic(() => import('@components/Markdown'))
const Guidelines: NextPage<GuidelinesProps> = ({ content }) => {
return (
<Docs
header='가이드라인'
description='리스트에 등재되는 모든 봇들이 지켜야하는 가이드라인입니다!'
subheader='최초 작성: 2020-04-30 수정: 2020-05-15'
>
<h1 className='mb-3 text-4xl font-bold'>KOREANBOTS에 .</h1>
<p> .</p>
<p> , .</p>
<h2 className='mt-10 text-3xl font-semibold' id='봇'>
</h2>
<p> .</p>
<ul className='list-inside list-disc'>
<li> .</li>
<li> (NSFW의 NSFW를 .)</li>
<li>
(
)
</li>
<li>
100 ,
.
</li>
<li> , </li>
<li> ( )</li>
<li>
, <strong></strong> .
, .
<ul className='pl-3 list-inside list-disc'>
<li>
<strong> </strong>(MIT )
, .
</li>
<li>
, (예시: Just Some Bot을
, RedBot .)
<br />
, .
</li>
</ul>
</li>
</ul>
<h3 className='mt-x text-lg font-semibold' id='금지사항'>
</h3>
<p> .</p>
<ul className='list-inside list-disc'>
<li> .</li>
<li>
<strong>TOS</strong> <strong></strong>, <strong> </strong>
.
</li>
<li>
, , /
</li>
<li> , API </li>
</ul>
<h2 className='mt-10 text-3xl font-semibold' id='유저'>
</h2>
<p>
( )
.
</p>
<ul className='list-inside list-disc'>
<li>
<strong>TOS</strong> <strong></strong>, <strong> </strong>{' '}
<strong> </strong>, <strong> </strong>,{' '}
<strong> </strong>
</li>
</ul>
<p className='mt-10'>
. ,
.
</p>
<p>
<strong> </strong> .
</p>
<Markdown text={content} />
</Docs>
)
}
export default Privacy
interface GuidelinesProps {
content: string
}
export const getStaticProps: GetStaticProps<GuidelinesProps> = async () => {
const res = await fetch(SpecialEndPoints.Github.Content('koreanbots', 'terms', 'guidelines.md'))
const json = await res.json()
return {
props: {
content: Buffer.from(json.content, 'base64').toString('utf-8')
}
}
}
export default Guidelines

View File

@ -1,125 +1,32 @@
import { NextPage } from 'next'
import { GetStaticProps, NextPage } from 'next'
import dynamic from 'next/dynamic'
import fetch from 'node-fetch'
import { SpecialEndPoints } from '@utils/Constants'
const Docs = dynamic(()=> import('@components/Docs'))
const Markdown = dynamic(() => import('@components/Markdown'))
const Privacy: NextPage = () => {
const Privacy: NextPage<PrivacyProps> = ({ content }) => {
return (
<Docs header='개인정보취급방침' description='저희가 개인정보를 취급하는 방침입니다.'>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<p>
"한국 디스코드봇 리스트"('https://koreanbots.dev')
, .
</p>
<ul className='list-inside list-disc'>
<li> </li>
<li> </li>
<li> </li>
</ul>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<ul className='list-inside list-disc'>
<li>
유저: 디스코드 Oauth를 (, ID, , ,
), (IP주소, ), | 선택항목: Github
</li>
<li>
: 등록일, ID, , , , , , , ,
, , , Status | 선택항목: 웹사이트, GIT URL, ,
</li>
</ul>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<p>
<strong> </strong> ,
.
</p>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<p>
.
</p>
<p>
,
.
</p>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<p>
,
.
</p>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<p>
.
</p>
<h3> </h3>
<ul className='list-inside list-disc'>
<li>성명: 박준서</li>
<li>직책: 대표</li>
<li>
: <a href='mailto:wonderlandpark@callisto.team'></a>
@wonderlandpark#9999
</li>
</ul>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<p> 7 .</p>
<h2 className='mt-10 text-3xl font-medium'> </h2>
<p> , .</p>
<p>
, ,
.
</p>
<p>
(, )
<br />
- 소관업무 : 개인정보 ,
<br />
- 신고 : privacy.kisa.or.kr
<br />
- 신고 : privacyclean@kisa.or.kr
<br />
- 신고 : 118 (ARS 2)
<br />
- : 061-820-2619
<br />
- / : (58324) 9( 301-2) 3
<br />
</p>
<p>
<br />
- 소관업무 : 개인정보 ,
<br />
- 신청 : www.kopico.go.kr
<br />
- () : (03171) 209 4
(1833-6972)
<br />
</p>
<p>
<br />
- 소관업무 : 각종 /
<br />
- 신고 : cybercid@spo.go.kr
<br />
- : () 1301, 02-3480-3570
<br />
</p>
<p>
<br />
- 소관업무 : 개인정보 ,
<br />
- 신고 : cyberbureau.police.go.kr
<br />
- 전화 : 182( )
<br />
</p>
<Markdown text={content} />
</Docs>
)
}
export default Privacy
export const getStaticProps: GetStaticProps<PrivacyProps> = async () => {
const res = await fetch(SpecialEndPoints.Github.Content('koreanbots', 'terms', 'privacy-policy.md'))
const json = await res.json()
return {
props: {
content: Buffer.from(json.content, 'base64').toString('utf-8')
}
}
}
interface PrivacyProps {
content: string
}
export default Privacy

37
pages/tos.tsx Normal file
View File

@ -0,0 +1,37 @@
import { GetStaticProps, NextPage } from 'next'
import dynamic from 'next/dynamic'
import { SpecialEndPoints } from '@utils/Constants'
const Docs = dynamic(()=> import('@components/Docs'))
const Markdown = dynamic(() => import('@components/Markdown'))
const ToS: NextPage<ToSProps> = ({ content }) => {
return (
<Docs
header='서비스 이용약관'
description='한국 디스코드봇 리스트의 서비스를 이용하실 때 지켜야하는 약관입니다.'
>
<Markdown text={content} />
</Docs>
)
}
interface ToSProps {
content: string
}
export const getStaticProps: GetStaticProps<ToSProps> = async () => {
const res = await fetch(SpecialEndPoints.Github.Content('koreanbots', 'terms', 'tos.md'))
const json = await res.json()
return {
props: {
content: Buffer.from(json.content, 'base64').toString('utf-8')
}
}
}
export default ToS

View File

@ -198,6 +198,7 @@ export const KoreanbotsEndPoints = {
export const SpecialEndPoints = {
Github: {
Content: (owner: string, repo: string, path: string) => `https://api.github.com/repos/${owner}/${repo}/contents/${path}`,
Token: (clientID: string, clientSecret: string, code: string) => `https://github.com/login/oauth/access_token?client_id=${clientID}&client_secret=${clientSecret}&code=${code}`,
Me: 'https://api.github.com/user'
},