From 4b1376b951f36d356b51790c1441dd11952cb864 Mon Sep 17 00:00:00 2001 From: Steven Lybeck Date: Thu, 15 Aug 2024 11:55:10 -0700 Subject: [PATCH] prep for github pages --- .github/workflows/deploy.yml | 22 +++++++++++++++ .gitignore | 3 ++ app/page.tsx | 4 +-- app/podcast/page.tsx | 4 +-- app/profile/page.tsx | 10 +++---- app/projects/page.tsx | 8 +++--- .../PlaceholderImage.tsx | 28 +++++++++---------- next.config.js | 18 ++++++------ package.json | 5 ++-- 9 files changed, 63 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/deploy.yml rename app/api/placeholder/[width]/[height]/route.ts => components/PlaceholderImage.tsx (54%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7053888 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '18' + - run: npm ci + - run: npm run export + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./out \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8ec85a1..a6c46d3 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,6 @@ jspm_packages .node_repl_history .next .DS_Store + +# nextjs static site output +out diff --git a/app/page.tsx b/app/page.tsx index 128d08b..faec3ba 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import Image from 'next/image'; +import PlaceholderImage from '../components/PlaceholderImage'; import styles from './styles/shared.module.css'; export default function Home() { @@ -15,7 +15,7 @@ export default function Home() {

Making It Home Podcast

- Making It Home Podcast Cover +

Explore my new podcast where I interview people about their past homes, discussing built environment, community, and personal memories. Join me in uncovering the stories that make a house a home.

Learn More About the Podcast
diff --git a/app/podcast/page.tsx b/app/podcast/page.tsx index b3cf1e4..9b32f20 100644 --- a/app/podcast/page.tsx +++ b/app/podcast/page.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import Image from 'next/image'; +import PlaceholderImage from '@/components/PlaceholderImage'; import styles from '../styles/shared.module.css'; export default function Podcast() { return (

Making It Home

- Making It Home Podcast Cover +

About the Podcast

diff --git a/app/profile/page.tsx b/app/profile/page.tsx index a813161..778fa27 100644 --- a/app/profile/page.tsx +++ b/app/profile/page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import Image from 'next/image'; +import PlaceholderImage from '@/components/PlaceholderImage'; import styles from '../styles/shared.module.css'; export default function Profile() { @@ -9,7 +9,7 @@ export default function Profile() {

Introduction

- Placeholder for profile header +
  • I'm a software engineer, a mover, and a human who grew up in Northern California. I moved to Berkeley to study art at UC Berkeley, and have spent most of my post-college life living in the East Bay.
  • I want to become a housing developer because I believe a lack of housing is a primary driver of challenges faced by Californians, and I believe that well-designed built environments are key to providing people with the basics of a good life: connection, activity, health and prosperity.
  • @@ -19,7 +19,7 @@ export default function Profile() {

    Early Background

    - Placeholder for early background +
    • I began learning to program in elementary school. My interest was supercharged when I discovered that I could publish websites and be connected to people all around the world.
    • In high school, I applied these abilities to a web development company called Epoch Media. I made websites for local businesses, artists, and merchants. I was even featured on a nationwide news broadcast about teen business owners!
    • @@ -31,7 +31,7 @@ export default function Profile() {

      Career in Software Engineering

      - Placeholder for software career +
      • After college, I pivoted back to software engineering. The money was good, and student loans and housing are pricey.
      • I began a freelance career that exposed me to small businesses, game development companies, VC-funded startups, and eventually publicly traded companies.
      • @@ -57,7 +57,7 @@ export default function Profile() {

        Transition to Housing Development

        - Placeholder for transition +
        • I've been meeting people from different sides of real estate development - investors, architects, design-build companies, developers, city planners, startup people - and learning everything I can from them!
        • The gaps for me are clear - I'm a software developer, and while I have executed a few small homeowner projects, I have a lot to learn when it comes to bringing together the parties involved in getting housing built from the ground up.
        • diff --git a/app/projects/page.tsx b/app/projects/page.tsx index 559ae78..179388c 100644 --- a/app/projects/page.tsx +++ b/app/projects/page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import Image from 'next/image'; +import PlaceholderImage from '@/components/PlaceholderImage'; import styles from '../styles/shared.module.css'; export default function Projects() { @@ -9,19 +9,19 @@ export default function Projects() {

          3D Robot Arm Visualization

          - Placeholder for Robot Arm Visualization +

          A 3D visualization of a robot arm to visualize data streaming into a management platform for fleets of robotics.

          WebRTC Bridge for Robot Control

          - Placeholder for WebRTC Bridge +

          A WebRTC bridge for direct control of mobile robots from a web browser.

          NextJS-based UX Development Framework

          - Placeholder for NextJS Framework +

          A NextJS-based framework supporting UX development for hundreds of engineers.

diff --git a/app/api/placeholder/[width]/[height]/route.ts b/components/PlaceholderImage.tsx similarity index 54% rename from app/api/placeholder/[width]/[height]/route.ts rename to components/PlaceholderImage.tsx index 06423a3..04b8273 100644 --- a/app/api/placeholder/[width]/[height]/route.ts +++ b/components/PlaceholderImage.tsx @@ -1,12 +1,12 @@ -import { NextRequest } from 'next/server'; +import React from 'react'; -export async function GET( - request: NextRequest, - { params }: { params: { width: string; height: string } } -) { - const width = parseInt(params.width, 10); - const height = parseInt(params.height, 10); +interface PlaceholderImageProps { + width: number; + height: number; + alt: string; +} +const PlaceholderImage: React.FC = ({ width, height, alt }) => { const svg = ` @@ -18,10 +18,10 @@ export async function GET( `; - return new Response(svg, { - headers: { - 'Content-Type': 'image/svg+xml', - 'Cache-Control': 'public, max-age=31536000, immutable', - }, - }); -} \ No newline at end of file + const encodedSVG = encodeURIComponent(svg); + const dataURI = `data:image/svg+xml,${encodedSVG}`; + + return {alt}; +}; + +export default PlaceholderImage; \ No newline at end of file diff --git a/next.config.js b/next.config.js index 43f9e33..8183ea6 100644 --- a/next.config.js +++ b/next.config.js @@ -1,13 +1,11 @@ -module.exports = { +/** @type {import('next').NextConfig} */ +const nextConfig = { + output: 'export', images: { - dangerouslyAllowSVG: true, - remotePatterns: [ - { - protocol: 'http', - hostname: 'localhost', - port: '3000', - pathname: '/api/**' - }, - ], + unoptimized: true, }, + // GitHub Pages use a custom domain or a repo name as the base path + // basePath: '/your-repo-name', // Replace with your actual repo name } + +module.exports = nextConfig diff --git a/package.json b/package.json index 7eebfb8..63a5690 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "export": "next build" }, "dependencies": { "next": "^14.2.5", @@ -19,4 +20,4 @@ "@types/react-dom": "^18.2.4", "typescript": "^5.0.4" } -} +} \ No newline at end of file