From e0de86bb5a574b4f35f12c23ed0b61a26dc756e0 Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Sun, 26 Nov 2023 09:36:23 -0800 Subject: [PATCH] Renaming pages and adding content --- package.json | 4 +- prettier.config.js | 2 +- .../page.mdx | 0 .../planetaria-design-system.png | Bin .../introducing-animaginary/page.mdx | 0 src/app/{articles => blog}/page.tsx | 17 +- .../page.mdx | 0 src/app/club/page.tsx | 101 ++++++ src/app/feed.xml/route.ts | 44 +-- src/app/hall-history/page.tsx | 301 ++++++++++++++++++ src/app/page.tsx | 18 +- src/app/{about => rental}/page.tsx | 59 ++-- src/components/ArticleLayout.tsx | 4 +- src/components/Footer.tsx | 7 +- src/components/Header.tsx | 18 +- src/lib/articles.ts | 43 ++- 16 files changed, 501 insertions(+), 117 deletions(-) rename src/app/{articles => blog}/crafting-a-design-system-for-a-multiplanetary-future/page.mdx (100%) rename src/app/{articles => blog}/crafting-a-design-system-for-a-multiplanetary-future/planetaria-design-system.png (100%) rename src/app/{articles => blog}/introducing-animaginary/page.mdx (100%) rename src/app/{articles => blog}/page.tsx (68%) rename src/app/{articles => blog}/rewriting-the-cosmos-kernel-in-rust/page.mdx (100%) create mode 100644 src/app/club/page.tsx create mode 100644 src/app/hall-history/page.tsx rename src/app/{about => rental}/page.tsx (58%) diff --git a/package.json b/package.json index a4815c7..61d6f7c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "tailwindui-template", + "name": "wscc-website", "version": "0.1.0", "private": true, "scripts": { @@ -40,4 +40,4 @@ "prettier-plugin-tailwindcss": "^0.5.2", "sharp": "^0.32.0" } -} +} \ No newline at end of file diff --git a/prettier.config.js b/prettier.config.js index 6b16840..53b6de6 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,6 +1,6 @@ /** @type {import('prettier').Options} */ module.exports = { singleQuote: true, - semi: false, + semi: true, plugins: ['prettier-plugin-tailwindcss'], } diff --git a/src/app/articles/crafting-a-design-system-for-a-multiplanetary-future/page.mdx b/src/app/blog/crafting-a-design-system-for-a-multiplanetary-future/page.mdx similarity index 100% rename from src/app/articles/crafting-a-design-system-for-a-multiplanetary-future/page.mdx rename to src/app/blog/crafting-a-design-system-for-a-multiplanetary-future/page.mdx diff --git a/src/app/articles/crafting-a-design-system-for-a-multiplanetary-future/planetaria-design-system.png b/src/app/blog/crafting-a-design-system-for-a-multiplanetary-future/planetaria-design-system.png similarity index 100% rename from src/app/articles/crafting-a-design-system-for-a-multiplanetary-future/planetaria-design-system.png rename to src/app/blog/crafting-a-design-system-for-a-multiplanetary-future/planetaria-design-system.png diff --git a/src/app/articles/introducing-animaginary/page.mdx b/src/app/blog/introducing-animaginary/page.mdx similarity index 100% rename from src/app/articles/introducing-animaginary/page.mdx rename to src/app/blog/introducing-animaginary/page.mdx diff --git a/src/app/articles/page.tsx b/src/app/blog/page.tsx similarity index 68% rename from src/app/articles/page.tsx rename to src/app/blog/page.tsx index a4ffb22..a65d0c7 100644 --- a/src/app/articles/page.tsx +++ b/src/app/blog/page.tsx @@ -2,14 +2,14 @@ import { type Metadata } from 'next' import { Card } from '@/components/Card' import { SimpleLayout } from '@/components/SimpleLayout' -import { type ArticleWithSlug, getAllArticles } from '@/lib/articles' +import { type BlogPostWithSlug, getAllBlogPosts } from '@/lib/articles' import { formatDate } from '@/lib/formatDate' -function Article({ article }: { article: ArticleWithSlug }) { +function Article({ article }: { article: BlogPostWithSlug }) { return (
- + {article.title}
diff --git a/src/app/articles/rewriting-the-cosmos-kernel-in-rust/page.mdx b/src/app/blog/rewriting-the-cosmos-kernel-in-rust/page.mdx similarity index 100% rename from src/app/articles/rewriting-the-cosmos-kernel-in-rust/page.mdx rename to src/app/blog/rewriting-the-cosmos-kernel-in-rust/page.mdx diff --git a/src/app/club/page.tsx b/src/app/club/page.tsx new file mode 100644 index 0000000..09efa1e --- /dev/null +++ b/src/app/club/page.tsx @@ -0,0 +1,101 @@ +import { type Metadata } from 'next' +import Image from 'next/image' +import Link from 'next/link' +import clsx from 'clsx' + +import { Container } from '@/components/Container' +import { + InstagramIcon, + TwitterIcon, +} from '@/components/SocialIcons' +import portraitImage from '@/images/portrait.jpg' + +function SocialLink({ + className, + href, + children, + icon: Icon, +}: { + className?: string + href: string + icon: React.ComponentType<{ className?: string }> + children: React.ReactNode +}) { + return ( +
  • + + + {children} + +
  • + ) +} + +function MailIcon(props: React.ComponentPropsWithoutRef<'svg'>) { + return ( + + ) +} + +export const metadata: Metadata = { + title: 'History', + description: + 'The West Sound Community Club on Orcas Island.', +} + +export default function Club() { + return ( + +
    +
    +
    + +
    +
    +
    +

    + West Sound Community Club +

    +
    +

    + The West Sound Community Club, a nonprofit, tax-exempt corporation + under Section 501(c)3 of the Internal Revenue Code, owns and manages + the Hall. The Club sponsors monthly community potlucks at the Hall + from September through May. +

    +
    +
    +
    +
      + + Membership Form + + + Donations + + + contact@westsoundhall.org + +
    +
    +
    +
    + ) +} diff --git a/src/app/feed.xml/route.ts b/src/app/feed.xml/route.ts index 1ed7c48..1adbcc9 100644 --- a/src/app/feed.xml/route.ts +++ b/src/app/feed.xml/route.ts @@ -1,18 +1,18 @@ -import assert from 'assert' -import * as cheerio from 'cheerio' -import { Feed } from 'feed' +import assert from 'assert'; +import * as cheerio from 'cheerio'; +import { Feed } from 'feed'; export async function GET(req: Request) { - let siteUrl = process.env.NEXT_PUBLIC_SITE_URL + let siteUrl = process.env.NEXT_PUBLIC_SITE_URL; if (!siteUrl) { - throw Error('Missing NEXT_PUBLIC_SITE_URL environment variable') + throw Error('Missing NEXT_PUBLIC_SITE_URL environment variable'); } let author = { name: 'Spencer Sharp', email: 'spencer@planetaria.tech', - } + }; let feed = new Feed({ title: author.name, @@ -26,28 +26,28 @@ export async function GET(req: Request) { feedLinks: { rss2: `${siteUrl}/feed.xml`, }, - }) + }); let articleIds = require - .context('../articles', true, /\/page\.mdx$/) + .context('../blog', true, /\/page\.mdx$/) .keys() .filter((key) => key.startsWith('./')) - .map((key) => key.slice(2).replace(/\/page\.mdx$/, '')) + .map((key) => key.slice(2).replace(/\/page\.mdx$/, '')); for (let id of articleIds) { - let url = String(new URL(`/articles/${id}`, req.url)) - let html = await (await fetch(url)).text() - let $ = cheerio.load(html) + let url = String(new URL(`/blog/${id}`, req.url)); + let html = await (await fetch(url)).text(); + let $ = cheerio.load(html); - let publicUrl = `${siteUrl}/articles/${id}` - let article = $('article').first() - let title = article.find('h1').first().text() - let date = article.find('time').first().attr('datetime') - let content = article.find('[data-mdx-content]').first().html() + let publicUrl = `${siteUrl}/blog/${id}`; + let article = $('article').first(); + let title = article.find('h1').first().text(); + let date = article.find('time').first().attr('datetime'); + let content = article.find('[data-mdx-content]').first().html(); - assert(typeof title === 'string') - assert(typeof date === 'string') - assert(typeof content === 'string') + assert(typeof title === 'string'); + assert(typeof date === 'string'); + assert(typeof content === 'string'); feed.addItem({ title, @@ -57,7 +57,7 @@ export async function GET(req: Request) { author: [author], contributor: [author], date: new Date(date), - }) + }); } return new Response(feed.rss2(), { @@ -66,5 +66,5 @@ export async function GET(req: Request) { 'content-type': 'application/xml', 'cache-control': 's-maxage=31556952', }, - }) + }); } diff --git a/src/app/hall-history/page.tsx b/src/app/hall-history/page.tsx new file mode 100644 index 0000000..cf47a6b --- /dev/null +++ b/src/app/hall-history/page.tsx @@ -0,0 +1,301 @@ +import { type Metadata } from 'next' +import Image from 'next/image' +import Link from 'next/link' +import clsx from 'clsx' +import { Card } from '@/components/Card' + +import { Container } from '@/components/Container' +import { + GitHubIcon, + InstagramIcon, + LinkedInIcon, + TwitterIcon, +} from '@/components/SocialIcons' +import portraitImage from '@/images/portrait.jpg' + +function SocialLink({ + className, + href, + children, + icon: Icon, +}: { + className?: string + href: string + icon: React.ComponentType<{ className?: string }> + children: React.ReactNode +}) { + return ( +
  • + + + {children} + +
  • + ) +} + +function MailIcon(props: React.ComponentPropsWithoutRef<'svg'>) { + return ( + + ) +} + +function TimelineEntry({ + title, + description, + event, + cta, + href, + children +}: { + title: string + description: string + event?: string + cta?: string + href?: string + children?: React.ReactNode +}) { + return ( + + + {title} + + {event + ? {event} + : null} + {description} + {cta + ? {cta} + : null} + {children} + + ) +} + +function DateListItem({ + year, value +}: { + year?: string + value: string +}) { + return ( +
    +
    {year}
    +
    {value}
    +
    + ) +} + +export const metadata: Metadata = { + title: 'History', + description: + 'The history of the West Sound Community Hall on Orcas Island.', +} + +export default function About() { + return ( + +
    +
    +
    + +
    +
    +
    +

    + Hall History +

    +
    +

    + The West Sound Community Hall represents the history and character + of Orcas Island. Members of the nonprofit West Sound Community Club, + as stewards of the Hall, strive to maintain the integrity of the + Hall as a unique gathering place for future generations. +

    +

    + In 1902 volunteers began building the Hall with materials supplied by George + Adkins. The building site was donated two years earlier by Alexander Chalmers. + The Hall was erected to serve as a central meeting place for residents of the + West Sound area. +

    +

    + Over the years the original one-room schoolhouse design has + changed to fit the times. A kitchen, stage, and entrance porch + were added to enhance the building's function. +

    +

    + Numerous organizations have used the Hall for meetings. In + addition, weddings, concerts, elections, parties, and other events + have been regularly held in the Hall since 1902. +

    +
    +
    +

    + Detailed History +

    + + + + + + +
    + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
      + + Follow on Twitter + + + Follow on Instagram + + + Follow on GitHub + + + Follow on LinkedIn + + + contact@westsoundhall.org + +
    +
    +
    +
    + ) +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 5e425fd..2659d05 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -20,7 +20,7 @@ import image2 from '@/images/photos/image-2.jpg' import image3 from '@/images/photos/image-3.jpg' import image4 from '@/images/photos/image-4.jpg' import image5 from '@/images/photos/image-5.jpg' -import { type ArticleWithSlug, getAllArticles } from '@/lib/articles' +import { type BlogPostWithSlug, getAllBlogPosts } from '@/lib/articles' import { formatDate } from '@/lib/formatDate' function MailIcon(props: React.ComponentPropsWithoutRef<'svg'>) { @@ -82,10 +82,10 @@ function ArrowDownIcon(props: React.ComponentPropsWithoutRef<'svg'>) { ) } -function Article({ article }: { article: ArticleWithSlug }) { +function Article({ article }: { article: BlogPostWithSlug }) { return ( - + {article.title} @@ -266,20 +266,20 @@ function Photos() { } export default async function Home() { - let articles = (await getAllArticles()).slice(0, 4) + let articles = (await getAllBlogPosts()).slice(0, 4) return ( <>

    - Software designer, founder, and amateur astronaut. + West Sound Community Hall

    - I’m Spencer, a software designer and entrepreneur based in New York - City. I’m the founder and CEO of Planetaria, where we develop - technologies that empower regular people to explore space on their - own terms. + WestSound Community Hall, located at 884 Deer Harbor Road in the hamlet of West Sound, has served as a public assembly hall since it was built by volunteers in 1902. +

    +

    + Facing West Sound, the Hall is at the heart of the WestSound community.

    ) { } export const metadata: Metadata = { - title: 'About', + title: 'History', description: - 'I’m Spencer Sharp. I live in New York City, where I design the future.', + 'The history of the West Sound Community Hall on Orcas Island.', } -export default function About() { +export default function Rental() { return (
    @@ -69,58 +69,47 @@ export default function About() {

    - I’m Spencer Sharp. I live in New York City, where I design the - future. + Hall Rental

    - I’ve loved making things for as long as I can remember, and wrote - my first program when I was 6 years old, just two weeks after my - mom brought home the brand new Macintosh LC 550 that I taught - myself to type on. + The WestSound Community Hall is a public assembly hall, which has + been in continuous operation since it was built in 1902. In 1999, + the Hall was listed on the Washington Heritage Register. The West + Sound Community Club, as steward of the Hall, makes the Hall + available for nonprofit purposes. Rental fees, shown below, are used + to pay Hall operating and maintenance expenses.

    - The only thing I loved more than computers as a kid was space. - When I was 8, I climbed the 40-foot oak tree at the back of our - yard while wearing my older sister’s motorcycle helmet, counted - down from three, and jumped — hoping the tree was tall enough that - with just a bit of momentum I’d be able to get to orbit. + Rental and deposit fees must be paid prior to obtaining access for + set-up. Rental fees include use of the meeting room, projector + and stage, chairs and tables, kitchen, rest rooms, water, and + lights. It does not include trash removal. Cleanup of the Hall + including removal of trash from the property the same day as the + event are the responsibilities of the renter.

    - I spent the next few summers indoors working on a rocket design, - while I recovered from the multiple surgeries it took to fix my - badly broken legs. It took nine iterations, but when I was 15 I - sent my dad’s Blackberry into orbit and was able to transmit a - photo back down to our family computer from space. -

    -

    - Today, I’m the founder of Planetaria, where we’re working on - civilian space suits and manned shuttle kits you can assemble at - home so that the next generation of kids really can make - it to orbit — from the comfort of their own backyards. + Damage and cleanup deposits, paid in advance, are refundable upon + satisfactory inspection of the Hall after the event. If there is + damage to the Hall or cleaning is necessary, deductions will be + made at the discretion of the Board.

      - Follow on Twitter + Rental Application Form - Follow on Instagram - - - Follow on GitHub - - - Follow on LinkedIn + Rental Q&A - spencer@planetaria.tech + contact@westsoundhall.org
    diff --git a/src/components/ArticleLayout.tsx b/src/components/ArticleLayout.tsx index 0b0f4b8..923cf96 100644 --- a/src/components/ArticleLayout.tsx +++ b/src/components/ArticleLayout.tsx @@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation' import { AppContext } from '@/app/providers' import { Container } from '@/components/Container' import { Prose } from '@/components/Prose' -import { type ArticleWithSlug } from '@/lib/articles' +import { type BlogPostWithSlug } from '@/lib/articles' import { formatDate } from '@/lib/formatDate' function ArrowLeftIcon(props: React.ComponentPropsWithoutRef<'svg'>) { @@ -26,7 +26,7 @@ export function ArticleLayout({ article, children, }: { - article: ArticleWithSlug + article: BlogPostWithSlug children: React.ReactNode }) { let router = useRouter() diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 8abc8af..a292791 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -27,10 +27,9 @@ export function Footer() {
    - About - Projects - Speaking - Uses + History + Rental + Club

    © {new Date().getFullYear()} Spencer Sharp. All rights diff --git a/src/components/Header.tsx b/src/components/Header.tsx index e539381..def56b6 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -132,11 +132,10 @@ function MobileNavigation(

    @@ -179,11 +178,10 @@ function DesktopNavigation(props: React.ComponentPropsWithoutRef<'nav'>) { return ( ) diff --git a/src/lib/articles.ts b/src/lib/articles.ts index 662e675..73c965f 100644 --- a/src/lib/articles.ts +++ b/src/lib/articles.ts @@ -1,36 +1,33 @@ -import glob from 'fast-glob' +import glob from 'fast-glob'; -interface Article { - title: string - description: string - author: string - date: string +interface BlogPost { + title: string; + description: string; + author: string; + date: string; } -export interface ArticleWithSlug extends Article { - slug: string +export interface BlogPostWithSlug extends BlogPost { + slug: string; } -async function importArticle( - articleFilename: string, -): Promise { - let { article } = (await import(`../app/articles/${articleFilename}`)) as { - default: React.ComponentType - article: Article - } +async function importBlogPost(filename: string): Promise { + let { article } = (await import(`../app/blog/${filename}`)) as { + default: React.ComponentType; + article: BlogPost; + }; return { - slug: articleFilename.replace(/(\/page)?\.mdx$/, ''), + slug: filename.replace(/(\/page)?\.mdx$/, ''), ...article, - } + }; } -export async function getAllArticles() { +export async function getAllBlogPosts() { let articleFilenames = await glob('*/page.mdx', { - cwd: './src/app/articles', - }) + cwd: './src/app/blog', + }); - let articles = await Promise.all(articleFilenames.map(importArticle)) - - return articles.sort((a, z) => +new Date(z.date) - +new Date(a.date)) + const posts = await Promise.all(articleFilenames.map(importBlogPost)); + return posts.sort((a, z) => +new Date(z.date) - +new Date(a.date)); }