From 2cafbd877ce00891f072115874229d9e372d2290 Mon Sep 17 00:00:00 2001 From: Samuel Ping Date: Fri, 29 Dec 2023 18:43:52 -0500 Subject: [PATCH] Major overhaul --- .github/workflows/deploy.yml | 94 +- README.md | 3 + app/about/page.js | 17 + app/error.js | 7 + app/layout.js | 26 + app/not-found.js | 5 + app/page.js | 56 + app/projects/[slug]/page.js | 65 + app/projects/page.js | 26 + {src => app}/styles/globals.css | 0 components/Chip.js | 13 + components/Footer.js | 53 + .../HamburgerButton.js | 4 +- {src/components => components}/Logo.js | 6 +- components/Navbar.js | 67 + components/NavbarButton.js | 34 + components/ProjectCard.js | 44 + components/SP.js | 22 + components/iconButton.js | 18 + components/icons.js | 132 + components/leftArrowButton.js | 22 + components/mdx/components.js | 44 + components/notFound.js | 25 + components/projectCardCarousel.js | 23 + components/rightArrowButton.js | 22 + .../config => config}/NavbarButtons.config.js | 17 +- content/about.mdx | 9 + .../projects/chat_stat.mdx | 14 +- .../projects/covid-tracker.mdx | 17 +- .../projects/food-mood.mdx | 18 +- content/projects/matchat.mdx | 10 + .../projects/personal-website.mdx | 18 +- content/projects/plantfam.mdx | 10 + content/projects/shrimpify.mdx | 12 + content/projects/street-cred.mdx | 12 + .../projects/wild-walk.mdx | 14 +- .../projects/yelp-review-scraper.mdx | 12 +- jsconfig.json | 9 +- next.config.js | 10 +- package-lock.json | 10179 ++++++++++------ package.json | 27 +- public/assets/amazon-logo.png | Bin 61670 -> 0 bytes public/assets/c1-logo.png | Bin 21082 -> 0 bytes public/assets/cap-logo.jpg | Bin 6556 -> 0 bytes public/assets/code-ninjas_logo.jpg | Bin 50540 -> 0 bytes public/assets/mongodb-logo.png | Bin 22078 -> 0 bytes public/assets/oss-logo.png | Bin 5431 -> 0 bytes public/assets/sam-2.jpg | Bin 300525 -> 0 bytes public/assets/sam.jpg | Bin 594181 -> 168849 bytes public/assets/samuel-ping_resume.pdf | Bin 204085 -> 0 bytes src/components/Avatar.js | 19 - src/components/CardVariants/BaseCardModal.js | 55 - .../InvolvementCard/InvolvementCard.js | 54 - .../InvolvementCard/InvolvementCardPopup.js | 37 - .../CardVariants/ProjectCard/ProjectCard.js | 56 - .../ProjectCard/ProjectCardPopup.js | 46 - src/components/CardVariants/README.md | 5 - .../CardVariants/WorkCard/WorkCard.js | 54 - .../CardVariants/WorkCard/WorkCardPopup.js | 35 - src/components/ContactBar.js | 21 - src/components/ContactBarButton.js | 44 - src/components/CurvedText.js | 24 - src/components/Footer.js | 10 - .../IconButtonVariants/DownloadIconButton.js | 19 - .../ExternalWebsiteIconButton.js | 20 - .../IconButtonVariants/GithubIconButton.js | 20 - src/components/Navbar.js | 70 - src/components/NavbarButton.js | 34 - src/components/PageHeader.js | 7 - src/components/PdfViewer.js | 24 - src/components/SP.js | 73 - src/components/SiteLayout.js | 102 - src/components/Tooltip.js | 28 - src/config/ContactBarButtons.config.js | 41 - src/content/about.json | 3 - src/content/home.json | 18 - .../college-avenue-players-actor.md | 20 - .../involvement/hackru-project-lead.md | 18 - ...b-tennis-travel-team-travel-team-member.md | 16 - .../involvement/scarlet-council-member.md | 17 - .../involvement/usacs-tech-director.md | 25 - src/content/projects/matchat.md | 10 - src/content/projects/plantfam.md | 10 - src/content/projects/shrimpify.md | 12 - src/content/projects/street-cred.md | 17 - src/content/work/amazon.md | 12 - src/content/work/capital-one.md | 12 - src/content/work/code-ninjas.md | 12 - src/content/work/mongodb.md | 18 - .../work/rutgers-open-systems-solutions.md | 23 - src/pages/_app.js | 30 - src/pages/_document.js | 22 - src/pages/about.js | 34 - src/pages/index.js | 50 - src/pages/involvement.js | 54 - src/pages/projects.js | 50 - src/pages/resume.js | 44 - src/pages/work.js | 50 - src/utils/BlurHashToBase64.js | 22 - src/utils/CardSorter.js | 65 - src/utils/MarkdownProcessor.js | 16 - src/utils/RGBStringToDataURL.js | 47 - tailwind.config.js | 43 +- utils/dateUtils.js | 100 + utils/mdxUtils.js | 74 + 105 files changed, 7737 insertions(+), 5321 deletions(-) create mode 100644 app/about/page.js create mode 100644 app/error.js create mode 100644 app/layout.js create mode 100644 app/not-found.js create mode 100644 app/page.js create mode 100644 app/projects/[slug]/page.js create mode 100644 app/projects/page.js rename {src => app}/styles/globals.css (100%) create mode 100644 components/Chip.js create mode 100644 components/Footer.js rename {src/components => components}/HamburgerButton.js (95%) rename {src/components => components}/Logo.js (77%) create mode 100644 components/Navbar.js create mode 100644 components/NavbarButton.js create mode 100644 components/ProjectCard.js create mode 100644 components/SP.js create mode 100644 components/iconButton.js create mode 100644 components/icons.js create mode 100644 components/leftArrowButton.js create mode 100644 components/mdx/components.js create mode 100644 components/notFound.js create mode 100644 components/projectCardCarousel.js create mode 100644 components/rightArrowButton.js rename {src/config => config}/NavbarButtons.config.js (55%) create mode 100644 content/about.mdx rename src/content/projects/chat_stat.md => content/projects/chat_stat.mdx (71%) rename src/content/projects/covid-tracker.md => content/projects/covid-tracker.mdx (56%) rename src/content/projects/food-mood.md => content/projects/food-mood.mdx (80%) create mode 100644 content/projects/matchat.mdx rename src/content/projects/personal-website.md => content/projects/personal-website.mdx (78%) create mode 100644 content/projects/plantfam.mdx create mode 100644 content/projects/shrimpify.mdx create mode 100644 content/projects/street-cred.mdx rename src/content/projects/wild-walk.md => content/projects/wild-walk.mdx (66%) rename src/content/projects/yelp-review-scraper.md => content/projects/yelp-review-scraper.mdx (52%) delete mode 100755 public/assets/amazon-logo.png delete mode 100644 public/assets/c1-logo.png delete mode 100644 public/assets/cap-logo.jpg delete mode 100644 public/assets/code-ninjas_logo.jpg delete mode 100755 public/assets/mongodb-logo.png delete mode 100644 public/assets/oss-logo.png delete mode 100644 public/assets/sam-2.jpg delete mode 100755 public/assets/samuel-ping_resume.pdf delete mode 100644 src/components/Avatar.js delete mode 100644 src/components/CardVariants/BaseCardModal.js delete mode 100644 src/components/CardVariants/InvolvementCard/InvolvementCard.js delete mode 100644 src/components/CardVariants/InvolvementCard/InvolvementCardPopup.js delete mode 100644 src/components/CardVariants/ProjectCard/ProjectCard.js delete mode 100644 src/components/CardVariants/ProjectCard/ProjectCardPopup.js delete mode 100644 src/components/CardVariants/README.md delete mode 100644 src/components/CardVariants/WorkCard/WorkCard.js delete mode 100644 src/components/CardVariants/WorkCard/WorkCardPopup.js delete mode 100644 src/components/ContactBar.js delete mode 100644 src/components/ContactBarButton.js delete mode 100644 src/components/CurvedText.js delete mode 100644 src/components/Footer.js delete mode 100644 src/components/IconButtonVariants/DownloadIconButton.js delete mode 100644 src/components/IconButtonVariants/ExternalWebsiteIconButton.js delete mode 100644 src/components/IconButtonVariants/GithubIconButton.js delete mode 100644 src/components/Navbar.js delete mode 100644 src/components/NavbarButton.js delete mode 100644 src/components/PageHeader.js delete mode 100644 src/components/PdfViewer.js delete mode 100644 src/components/SP.js delete mode 100644 src/components/SiteLayout.js delete mode 100644 src/components/Tooltip.js delete mode 100644 src/config/ContactBarButtons.config.js delete mode 100644 src/content/about.json delete mode 100644 src/content/home.json delete mode 100644 src/content/involvement/college-avenue-players-actor.md delete mode 100644 src/content/involvement/hackru-project-lead.md delete mode 100644 src/content/involvement/rutgers-club-tennis-travel-team-travel-team-member.md delete mode 100644 src/content/involvement/scarlet-council-member.md delete mode 100644 src/content/involvement/usacs-tech-director.md delete mode 100644 src/content/projects/matchat.md delete mode 100644 src/content/projects/plantfam.md delete mode 100644 src/content/projects/shrimpify.md delete mode 100644 src/content/projects/street-cred.md delete mode 100644 src/content/work/amazon.md delete mode 100644 src/content/work/capital-one.md delete mode 100644 src/content/work/code-ninjas.md delete mode 100644 src/content/work/mongodb.md delete mode 100644 src/content/work/rutgers-open-systems-solutions.md delete mode 100644 src/pages/_app.js delete mode 100644 src/pages/_document.js delete mode 100644 src/pages/about.js delete mode 100644 src/pages/index.js delete mode 100644 src/pages/involvement.js delete mode 100644 src/pages/projects.js delete mode 100644 src/pages/resume.js delete mode 100644 src/pages/work.js delete mode 100644 src/utils/BlurHashToBase64.js delete mode 100644 src/utils/CardSorter.js delete mode 100644 src/utils/MarkdownProcessor.js delete mode 100644 src/utils/RGBStringToDataURL.js create mode 100644 utils/dateUtils.js create mode 100644 utils/mdxUtils.js diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7fc217b..f2a98fe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,7 +1,7 @@ # Builds and pushes frontend to gh-pages branch # Pushes backend to server branch -name: CI +name: deploy next.js site to gh pages # Controls when the action will run. on: @@ -14,35 +14,75 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: 'pages' + cancel-in-progress: false + jobs: # pushes frontend code to gh-pages branch - client-integration: - name: integrate-client + build: runs-on: ubuntu-latest steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # building the website - - uses: actions/setup-node@v2 - with: - node-version: '18' - - name: build site + # Checks out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v4 + - name: Detect package manager + id: detect-package-manager run: | - npm ci - npm run build - npm run export - touch out/.nojekyll - echo "# Hi!" > out/README.md - echo "You're currently looking at the build artifacts of my website. To check out the code, switch over to my [personal-website repository!](https://github.com/samuel-ping/personal-website)!" >> out/README.md - echo "#### Note - This message was automatically generated." >> out/README.md - working-directory: ./ - - - name: push build artifacts to samuel-ping.github.io - uses: s0/git-publish-subdir-action@develop - env: - REPO: git@github.com:samuel-ping/samuel-ping.github.io.git - BRANCH: gh-pages - FOLDER: ./out - SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_PRIVATE_KEY }} \ No newline at end of file + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + exit 0 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: npm + - name: Setup Pages + uses: actions/configure-pages@v4 + with: + # Automatically inject basePath in your Next.js configuration file and disable + # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: next + - name: Restore cache + uses: actions/cache@v3 + with: + path: | + .next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + - name: Install dependencies + run: npm ci + - name: Build with Next.js + run: npx next build + - name: Static HTML export with Next.js + run: npx next export + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./out + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 727d481..c546a66 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ This is my personal website's repository! Hopefully you're here because you like I built my website using Next.js and Tailwind CSS. +## Getting Started +Run `npm i` to install packages. Then `npm run dev` to run the site locally in dev mode. + ### Past Stuff #### Netlify CMS diff --git a/app/about/page.js b/app/about/page.js new file mode 100644 index 0000000..35ac7d6 --- /dev/null +++ b/app/about/page.js @@ -0,0 +1,17 @@ +import { getMDXComponent } from 'mdx-bundler/client'; + +import { Components as MDXComponents } from '@components/mdx/components'; + +import { GetAboutMDX } from '@utils/mdxUtils'; + +export default async function Page() { + const { code } = await GetAboutMDX('about'); + const Component = getMDXComponent(code); + + return ( +
+ About me + +
+ ); +} diff --git a/app/error.js b/app/error.js new file mode 100644 index 0000000..3687869 --- /dev/null +++ b/app/error.js @@ -0,0 +1,7 @@ +'use client'; + +import NotFound from '@components/notFound'; + +export default function Error() { + return ; +} diff --git a/app/layout.js b/app/layout.js new file mode 100644 index 0000000..5974bd9 --- /dev/null +++ b/app/layout.js @@ -0,0 +1,26 @@ +import Navbar from '@components/navbar'; +import Footer from '@components/footer'; + +import NavbarButtons from '@config/navbarButtons.config'; + +import './styles/globals.css'; + +export const metadata = { + title: { + default: 'Samuel Ping', + template: '%s | Sam Ping', + }, + description: 'Welcome to Next.js', +}; + +export default function RootLayout({ children }) { + return ( + + + +
{children}
+