From e70e50238d9d771dfaebe0542f24c529ccb8b127 Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Mon, 10 Apr 2023 11:26:53 +0800 Subject: [PATCH] Add rg ignore --- .rgignore | 2 + app/gists/[page]/page.tsx | 19 ++++---- app/projects/content.tsx | 97 ++++++++++++++++++++++++++++++++++++++ app/projects/page.tsx | 98 +-------------------------------------- 4 files changed, 110 insertions(+), 106 deletions(-) create mode 100644 .rgignore create mode 100644 app/projects/content.tsx diff --git a/.rgignore b/.rgignore new file mode 100644 index 0000000..78b0710 --- /dev/null +++ b/.rgignore @@ -0,0 +1,2 @@ +public/libs/* +public/models/* diff --git a/app/gists/[page]/page.tsx b/app/gists/[page]/page.tsx index cb711dc..bf2c9d6 100644 --- a/app/gists/[page]/page.tsx +++ b/app/gists/[page]/page.tsx @@ -1,17 +1,19 @@ -import { getGists } from "lib/fetcher"; -import { notFound } from "next/navigation"; -import FileContent from "../file-content"; +import { getGists } from 'lib/fetcher'; +import { notFound } from 'next/navigation'; +import FileContent from '../file-content'; import Pagination from 'components/rua/rua-pagination'; export const revalidate = 600; -export default async function Page({params}: { +export default async function Page({ + params, +}: { params: { - page: string - } + page: string; + }; }) { - const page = Number(params.page) - if (!page) notFound() + const page = Number(params.page); + if (!page) notFound(); const gists = await getGists(page); if (!gists) notFound(); @@ -33,5 +35,4 @@ export default async function Page({params}: { /> ); - } diff --git a/app/projects/content.tsx b/app/projects/content.tsx new file mode 100644 index 0000000..a049fef --- /dev/null +++ b/app/projects/content.tsx @@ -0,0 +1,97 @@ +import { + SiGitea, + SiNextdotjs, + SiRedux, + SiThreedotjs, + SiTsnode, + SiVim, +} from 'react-icons/si'; +import { VscGithubInverted } from 'react-icons/vsc'; +import { HiPhoto } from 'react-icons/hi2'; + +export const iconMap = { + gitea: , + nextjs: , + github: , + vim: , + tsnode: , + three: , + photos: , + redux: , +}; + +export type Project = { + id: number; + icon?: keyof typeof iconMap; + name: string; + description: string; + url: string; +}; + +export const projects: Project[] = [ + { + id: 0, + icon: 'three', + name: '3d-globe', + description: 'A 3d globe made by three.js.', + url: 'https://github.com/DefectingCat/3d-globe', + }, + { + id: 1, + icon: 'nextjs', + name: 'Blog', + description: 'This site.', + url: 'https://github.com/DefectingCat/DefectingCat.github.io', + }, + { + id: 2, + icon: 'tsnode', + name: 'boring-avatars-services', + description: 'Random avatars.', + url: 'https://github.com/DefectingCat/boring-avatars-services', + }, + { + id: 3, + icon: 'tsnode', + name: 'RUA DDNS', + description: 'DDNS Script for DNSPod', + url: 'https://github.com/DefectingCat/rua-ddns', + }, + { + id: 4, + icon: 'vim', + name: 'Dotfiles', + description: 'Some dotfiles.', + url: 'https://github.com/DefectingCat/dotfiles', + }, + { + id: 5, + icon: 'redux', + name: 'RUA-Context', + description: 'A global store for React.', + url: 'https://github.com/rua-plus/rua-context', + }, + { + id: 6, + icon: 'three', + name: 'RUA-Three', + description: 'A three.js hooks for React.', + url: 'https://github.com/rua-plus/rua-three', + }, +]; +export const selfHosts: Project[] = [ + { + id: 0, + icon: 'gitea', + name: 'Gitea', + description: 'Selfhost git.', + url: 'https://git.rua.plus/', + }, + { + id: 1, + icon: 'photos', + name: 'Photos', + description: 'Some photos.', + url: 'https://photos.rua.plus/browse', + }, +]; diff --git a/app/projects/page.tsx b/app/projects/page.tsx index 403f16d..98f37e5 100644 --- a/app/projects/page.tsx +++ b/app/projects/page.tsx @@ -1,108 +1,12 @@ -import { - SiGitea, - SiNextdotjs, - SiRedux, - SiThreedotjs, - SiTsnode, - SiVim, -} from 'react-icons/si'; -import { VscGithubInverted } from 'react-icons/vsc'; -import { HiPhoto } from 'react-icons/hi2'; import clsx from 'clsx'; import ProjectCard from './project-card'; import { Metadata } from 'next'; +import { projects, iconMap, selfHosts } from './content'; export const metadata: Metadata = { title: 'RUA - Projects', }; -const iconMap = { - gitea: , - nextjs: , - github: , - vim: , - tsnode: , - three: , - photos: , - redux: , -}; - -export type Project = { - id: number; - icon?: keyof typeof iconMap; - name: string; - description: string; - url: string; -}; - -const projects: Project[] = [ - { - id: 0, - icon: 'three', - name: '3d-globe', - description: 'A 3d globe made by three.js.', - url: 'https://github.com/DefectingCat/3d-globe', - }, - { - id: 1, - icon: 'nextjs', - name: 'Blog', - description: 'This site.', - url: 'https://github.com/DefectingCat/DefectingCat.github.io', - }, - { - id: 2, - icon: 'tsnode', - name: 'boring-avatars-services', - description: 'Random avatars.', - url: 'https://github.com/DefectingCat/boring-avatars-services', - }, - { - id: 3, - icon: 'tsnode', - name: 'RUA DDNS', - description: 'DDNS Script for DNSPod', - url: 'https://github.com/DefectingCat/rua-ddns', - }, - { - id: 4, - icon: 'vim', - name: 'Dotfiles', - description: 'Some dotfiles.', - url: 'https://github.com/DefectingCat/dotfiles', - }, - { - id: 5, - icon: 'redux', - name: 'RUA-Context', - description: 'A global store for React.', - url: 'https://github.com/rua-plus/rua-context', - }, - { - id: 6, - icon: 'three', - name: 'RUA-Three', - description: 'A three.js hooks for React.', - url: 'https://github.com/rua-plus/rua-three', - }, -]; -const selfHosts: Project[] = [ - { - id: 0, - icon: 'gitea', - name: 'Gitea', - description: 'Selfhost git.', - url: 'https://git.rua.plus/', - }, - { - id: 1, - icon: 'photos', - name: 'Photos', - description: 'Some photos.', - url: 'https://photos.rua.plus/browse', - }, -]; - export default function Page() { return ( <>