diff --git a/src/app/monthlychallenges/(challenges)/nov-2023/page.tsx b/src/app/monthlychallenges/(challenges)/nov-2023/page.tsx index f7e4131a..fa1d80c1 100644 --- a/src/app/monthlychallenges/(challenges)/nov-2023/page.tsx +++ b/src/app/monthlychallenges/(challenges)/nov-2023/page.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/no-unescaped-entities */ import { Fragment } from 'react'; import { createMetaData } from '@/util/createMetaData.server'; -import { getChallengeData } from '@/data/monthlyChallenges/nov-2023'; +import { getWritingChallengeData } from '@/data/monthlyChallenges/NaNoWriMo'; import LeadText from '@/components/content/LeadText'; import Link from 'next/link'; import DefaultLayout from '@/components/layouts/DefaultLayout'; @@ -24,7 +24,7 @@ export const metadata = handle.meta; async function getData() { const { title } = handle.meta; - const data = await getChallengeData(); + const data = await getWritingChallengeData('NaNoWriMo 2024'); const description = `Current status: ${data.totals.totalCount.toLocaleString()} out of ${ data.currentGoal?.title diff --git a/src/app/monthlychallenges/(challenges)/nov-2024/page.tsx b/src/app/monthlychallenges/(challenges)/nov-2024/page.tsx new file mode 100644 index 00000000..c7b3b4fa --- /dev/null +++ b/src/app/monthlychallenges/(challenges)/nov-2024/page.tsx @@ -0,0 +1,266 @@ +/* eslint-disable react/no-unescaped-entities */ +import { Fragment } from 'react'; +import { createMetaData } from '@/util/createMetaData.server'; +import { getWritingChallengeData } from '@/data/monthlyChallenges/NaNoWriMo'; +import LeadText from '@/components/content/LeadText'; +import DefaultLayout from '@/components/layouts/DefaultLayout'; + +const handle = { + listTitle: 'November, 2024: 50k words!', + meta: { + title: 'Monthly Theme & Challenge for November, 2024: 50k words!', + description: + 'November challenge -> Blogging: we all work together to hit 50,000 words.', + }, + date: '2024-11-01', + hero: { + heroHeader: '', + }, +}; + +export const metadata = handle.meta; + +async function getData() { + const { title } = handle.meta; + + const data = await getWritingChallengeData('NaNoWriMo 2024'); + + const description = `Current status: ${data.totals.totalCount.toLocaleString()} out of ${ + data.currentGoal?.title + } words`; + + return { + ...data, + meta: createMetaData({ title, description }), + }; +} + +export default async function Challenge() { + const { sortedList, totals, completedGoals, currentGoal, meta } = + await getData(); + + return ( + +

+ Monthly Challenge for November 2024: Let's write 50k + words together! +

+ + +

+ This month, we're working together to blog 50,000 words! Based off the{' '} + + NaNoWriMo (National Novel Writing Month) Challenge + + , we'll be doing the tech and non-tech take on writing and working + together towards the goal while posting on our own blogs. +

+

Get those blog posts up!

+
+ + {totals.totalPosts > 0 && ( + <> + {completedGoals.length ? ( + <> +

+ Current status: +

+ + + +
+ Stretch Goal {completedGoals.length}:{' '} + {totals.totalCount.toLocaleString()} out of{' '} + {currentGoal?.value.toLocaleString()} words +
+ + ) : ( +

+ Current status: {totals.totalCount.toLocaleString()} out of{' '} + {currentGoal?.title} words +

+ )} + +
+
+ {totals.totalCount.toLocaleString()} Words +
+
+ +

Our Posts:

+ + {sortedList.map((author, i) => ( + +
+

+ {author.name} +

+ + + Permalink to {author.name}'s posts + + + +
+ + +
+ ))} + +

Totals:

+ + + + + + + + + + + {totals.list.map((author, i) => ( + + + + + + ))} + + + + + + + + +
Member Totals + Posts + + Total Words +
{author.name} + {author.posts.toLocaleString()} + + {author.total.toLocaleString()} +
Total + {totals.totalPosts.toLocaleString()} + + {totals.totalCount.toLocaleString()} words +
+ + )} + +

How to Participate

+ +

+ Once you've written and published your content,{' '} + + add your entry to our VC NaNoWriMo entry form + + ! +

+ +

+ + Add Your Entry! + +

+ +

What kind of content counts towards the challenge?

+ +

+ Any tech-related or non-tech blog posts, articles, or novels published + in November! For tech-related posts, feel free to include code samples + in your word count totals (if it's a word and you wrote it, we'll count + it 😊). +

+ +

+ While we love good documentation here at Virtual Coffee, README docs, or + anything else you would typically consider documentation, it doesn't + count for this challenge. +

+ +

What if I'm not confident about my writing?

+ +

+ We all start somewhere. The more you practice, the better you'll get. We + have volunteers willing to proofread and give you feedback on your + writing. Just put a link to your draft in the{' '} + #monthly-challenge or #content-creation{' '} + channel and ask for the help you need. +

+ +

What if I don't know what to write about?

+ +

+ We've got you covered with extensive topic lists in{' '} + + this discussion + {' '} + and{' '} + + this discussion + + . +

+ +

And remember, we're always here to help ❤️

+ +

Resources

+ +
+ ); +} diff --git a/src/app/monthlychallenges/(challenges)/oct-2024/page.tsx b/src/app/monthlychallenges/(challenges)/oct-2024/page.tsx index fb4f5c3d..9e3d2bce 100644 --- a/src/app/monthlychallenges/(challenges)/oct-2024/page.tsx +++ b/src/app/monthlychallenges/(challenges)/oct-2024/page.tsx @@ -19,6 +19,11 @@ export const metadata = handle.meta; export default function Challenge() { return ( <> +
+ This monthly challenge is complete. Congratulations! Please join us for + the next challenge! +
+

Monthly Challenge for October 2024: It's Hacktoberfest! Participate in open source, learn, and have fun! diff --git a/src/app/monthlychallenges/page.tsx b/src/app/monthlychallenges/page.tsx index ceb3a62c..b1b2d1a1 100644 --- a/src/app/monthlychallenges/page.tsx +++ b/src/app/monthlychallenges/page.tsx @@ -190,26 +190,27 @@ const challengeList: Challenge[] = [ ], }, { + current: true, title: 'Blogging Challenge', - subtitle: `A Community Challenge to hit a word count goal for all our tech blogs.`, + subtitle: `A Community Challenge to hit a word count goal for all our tech and non-tech blogs.`, description: ( <>

- Based off the NaNoWriMo (National Novel Writing Month) Challenge, this - challenge is the tech take on writing and working together towards the + Based on the NaNoWriMo (National Novel Writing Month) Challenge, this + challenge is the tech and non-tech take on writing and working together towards the goal while posting on our own blogs.

-

+ {/*

Learn more about this challenge in{' '} this blog post . -

+

*/}

To view all of the details of this year's challenge,{' '} - - check out the November 2023 challenge page + + check out the November 2024 challenge page .

@@ -217,6 +218,9 @@ const challengeList: Challenge[] = [ ), links: [ { + href: '/monthlychallenges/nov-2023', + title: 'November, 2023', + }, { href: '/monthlychallenges/nov-2022', title: 'November, 2022', }, @@ -231,7 +235,6 @@ const challengeList: Challenge[] = [ ], }, { - current: true, title: 'Hacktoberfest', subtitle: `Participate in open source, learn, and have fun!`, description: ( diff --git a/src/data/monthlyChallenges/nov-2023.ts b/src/data/monthlyChallenges/NaNoWriMo.ts similarity index 96% rename from src/data/monthlyChallenges/nov-2023.ts rename to src/data/monthlyChallenges/NaNoWriMo.ts index 9fde5130..419837dc 100644 --- a/src/data/monthlyChallenges/nov-2023.ts +++ b/src/data/monthlyChallenges/NaNoWriMo.ts @@ -12,7 +12,7 @@ type NovRow = { created_at: string; }; -async function fetchRecords() { +async function fetchRecords(viewName: string) { if (process.env.PUBLIC_AIRTABLE_API_KEY) { const base = new Airtable({ apiKey: process.env.PUBLIC_AIRTABLE_API_KEY, @@ -20,7 +20,7 @@ async function fetchRecords() { const result = await base('NaNoWriMo') .select({ - view: 'NaNoWriMo 2023', + view: viewName, }) .all(); @@ -91,8 +91,8 @@ type PostMap = Record< } >; -export async function getChallengeData() { - const tableRows = await fetchRecords(); +export async function getWritingChallengeData(viewName: string) { + const tableRows = await fetchRecords(viewName); const totalCount = tableRows.reduce((total, row) => { return total + row.WordCount;