-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from reednel/develop
add quotes
- Loading branch information
Showing
4 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
"Featured here are real quotes from real people.", | ||
"I would recommend navigating to a page I actually put content on.", | ||
"They say you die twice: once when you die, and once when you've scratched and sniffed your last scratch and sniff sticker.", | ||
"My computer pays me no mind.", | ||
"We need to update our model.", | ||
"If you were prowling around the sarenghetti, and you found out about extra carbohydrates, you'd be excited too.", | ||
"Swamps comes from far and wide to marvel at the water seeping from this thing.", | ||
"...and it's not the size of a room, it's the size of a triscut.", | ||
"Not everything is true.", | ||
"Something was steeping.", | ||
"I would recommend watching About Time.", | ||
"Just because one fails to generalize something successfully doesn't mean they don't understand it.", | ||
"Idea: a shared Google doc, with all the relevant passwords.", | ||
"Idea: use cryptography to ensure the integrity of images and videos (combat deepfakes). Like issuing certificates to cameras, and then embedding secrets in the frames, except in a way that doesn't get compressed-away. Surely people are doing this if it's viable, but it's not clear to me why it wouldn't be.", | ||
"Idea: a comb with few and weird teeth, such that your hair gets brushed back the way you want but without that really clean comb-y look.", | ||
"Idea: a riddle that uses that a mouth has two corners, or an eye has one corner.", | ||
"The problem with organizing these pages all nicely and without redundancy is that then there's nothing to fill the landing page.", | ||
"That's me." | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
--- | ||
title: Home | ||
meta_title: Home | ||
|
||
banner: | ||
title: Reed Nelson | ||
qotd: "They say you die twice: once when you die, and once when you've scratched and sniffed your last scratch and sniff sticker." | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import fs from 'fs/promises'; | ||
import path from 'path'; | ||
|
||
const getRandomQuote = (quotes: string[]): string => { | ||
const randomIndex = Math.floor(Math.random() * quotes.length); | ||
return quotes[randomIndex]; | ||
}; | ||
|
||
// const getWeeklyQuote = (quotes: string[]): string => { | ||
// const today = new Date(); | ||
// const startOfYear = new Date(today.getFullYear(), 0, 1); | ||
// const weekNumber = Math.ceil((today - startOfYear) / (7 * 24 * 60 * 60 * 1000)); | ||
// return quotes[weekNumber % quotes.length]; | ||
// }; | ||
|
||
const getQuote = async (): Promise<string> => { | ||
try { | ||
const jsonFilePath = path.resolve('src/assets/quotes.json'); | ||
const jsonData = await fs.readFile(jsonFilePath, 'utf-8'); | ||
const quotes = JSON.parse(jsonData); | ||
return getRandomQuote(quotes); | ||
} catch (error) { | ||
throw new Error(`Error reading or processing the JSON file: ${error}`); | ||
} | ||
}; | ||
|
||
export default getQuote; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters