From 313611350ccc41a74a64c76f95aad19bd3333b4d Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh <46249765+quantum9Innovation@users.noreply.github.com> Date: Wed, 14 Feb 2024 22:49:58 +0000 Subject: [PATCH] Shorten code links in document view --- src/app/components/DataDisplay.tsx | 10 +++++++++- src/app/db/data.ts | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/components/DataDisplay.tsx b/src/app/components/DataDisplay.tsx index 0fe0dd7..c0426c7 100644 --- a/src/app/components/DataDisplay.tsx +++ b/src/app/components/DataDisplay.tsx @@ -6,6 +6,14 @@ import { topics as topicList, } from '@/app/db/data' +const getRepo = (link: string) => { + if (link.includes('github.com')) { + const owner = link.split('/')[3] + const name = link.split('/')[4] + return `git:${owner}/${name}` + } +} + export const Code = ({ code, showTitle = true, @@ -20,7 +28,7 @@ export const Code = ({ {code.map((c: string, i) => ( - {c} + {getRepo(c)} {i !== code.length - 1 ? ', ' : null} diff --git a/src/app/db/data.ts b/src/app/db/data.ts index 4ab581d..8f5c6c4 100644 --- a/src/app/db/data.ts +++ b/src/app/db/data.ts @@ -283,12 +283,12 @@ On Day 1 we will discuss the ins and outs of the robot. The Electrical Sub team 'eexiv-white-paper': { manifest: { title: 'eeXiv Whitepaper', - authors: ['ywu', 'avenkatesh'], + authors: ['avenkatesh', 'ywu'], topics: ['eecs', 'frc'], dates: [1707811359, 1707891311], type: 'whitepaper', latest: 2, - status: 'under review', + status: 'reviewed', keywords: [ 'eexiv', 'whitepaper',