Multi-part paths for Ourtober

main
Ashelyn Dawn 7 months ago
parent 447343e8ed
commit 5a221e75b9
No known key found for this signature in database
GPG Key ID: D1980B8C6F349BC1

@ -8,8 +8,6 @@ interface LinkProps {
export default function Link({href, children} : LinkProps) {
const isLocal = /^\/[^\/]/.test(href)
console.log(`href: ${href} - isLocal: ${isLocal}`)
if (isLocal)
return (
<NextLink href={href}>
@ -28,4 +26,4 @@ export default function Link({href, children} : LinkProps) {
{children}
</a>
)
}
}

@ -15,9 +15,12 @@ export default function PostHead({post} : PropTypes) {
return (
<>
<Head><title>{post.title} | ashe.gay</title></Head>
<Link href="/posts"><a>{'<'} see all posts</a></Link>
{post.prefix
? <Link href={`/${post.prefix}`}><a>{'<'} back</a></Link>
: <Link href="/posts"><a>{'<'} see all posts</a></Link>
}
<h1>{post.title}</h1>
<span className="date">{dateString}</span>
</>
)
}
}

@ -21,7 +21,7 @@ export async function getStaticPaths() {
export async function getStaticProps({params: {path}}) {
const posts = await getRawPosts()
const postFile = posts.find(post => post.path === path)
const postFile = posts.find(post => post.path.join('/') === path.join('/'))
const postFileWithImages = await processPostImages(postFile)
const post = await resolvePostType(postFileWithImages)
@ -30,4 +30,4 @@ export async function getStaticProps({params: {path}}) {
post
}
}
}
}

@ -18,12 +18,13 @@ import useStyleTransition from '~/hooks/useStyleTransition'
const easing = [0.175, 0.85, 0.42, 0.96]
export default function App({Component, pageProps, router: {route}} : AppProps) {
export default function App({Component, pageProps, router} : AppProps) {
const [darkTheme, setDarkTheme] = useLocalStorage('ashe_darktheme', false)
const prefersReducedMotion = useReducedMotion()
const isFirstRender = useFirstRender()
useStyleTransition();
const {asPath: route} = router
const headerIsExpanded = route === '/'
const page = () => (
@ -61,4 +62,4 @@ export default function App({Component, pageProps, router: {route}} : AppProps)
<Script strategy="afterInteractive" data-website-id="9e990037-e995-4bde-81b0-76e782355f14" src="https://analytics.tempest.dev/umami.js"/>
</>
)
}
}

@ -26,4 +26,4 @@ class MyDocument extends Document {
}
}
export default MyDocument
export default MyDocument

@ -125,7 +125,7 @@ function Thought({children, shouldStagger, className} : {children: ReactChild, s
export async function getStaticProps() : Promise<{props: PropTypes}>{
const posts = await getRawPosts()
const post = posts.find(post => post.path === 'coming-out')
const post = posts.find(post => post.path.join('/') === 'coming-out')
return {
@ -133,4 +133,4 @@ export async function getStaticProps() : Promise<{props: PropTypes}>{
post: await resolvePostType(post)
}
}
}
}

@ -48,7 +48,7 @@ export default function EmergencyContact () {
date: '2022-07-19',
title: 'In Case of Emergency',
unlisted: false,
path: 'in-emergency',
path: ['in-emergency'],
body: null,
tags: []
}}
@ -86,4 +86,4 @@ export default function EmergencyContact () {
<Signature/>
</>
)
}
}

@ -12,10 +12,10 @@ export default function PostList({posts} : {posts: Post[]}) {
<Head><title>Posts | ashe.gay</title></Head>
<h1>posts</h1>
{posts?.map(post => (
<div key={post.path} className={styles.post}>
<div key={post.path.join('/')} className={styles.post}>
<span className={styles.date}>{(new Date(Date.parse(post.date)).toLocaleDateString('en-US', {timeZone: 'UTC'}))}</span>
<div>
<Link href={`/${post.path}`}>
<Link href={`/${post.path.join('/')}`}>
<a className={styles.name}>{post.title}</a>
</Link>
<span className={styles.tags}>
@ -38,4 +38,4 @@ export async function getStaticProps() {
posts: posts.filter(post => !post.unlisted)
}
}
}
}

@ -0,0 +1,19 @@
---
title: 'Ourtober 2023'
unlisted: true
---
So every year for the past three years, I have participated with friends in a
month-long daily art prompt list we call "Ourtober".
This year I decided that rather than doing digital art (as is my normal method),
I was going to attempt to write poetry for each prompt. The following are my poems
for this event:
<span class="preserveCase"></span>
1. [Strands](/ourtober-2023/strands)
2. [Gothic](/ourtober-2023/gothic)
3. [Opportunities](/ourtober-2023/opportunities)
4. [Bleed](/ourtober-2023/bleed)
5. [Cirrus](/ourtober-2023/cirrus)

@ -0,0 +1,23 @@
---
title: Strands
prefix: ourtober-2023
unlisted: true
---
<span class="preserveCase"/>
<span class="preserveSpace"/>
Article of fading cloth
Taken, carried, through each home,
Comfort through the darkest nights
Beaten, battered, and re-sewn.
Memories of ages past
Friends and loved ones come and gone,
Still the beaten, tattered cloth
Now ill-fitting but still worn.
Folded gently on a shelf
Not yet ready hearts to part,
But someday some new face will
Bring it to another start.

@ -0,0 +1,13 @@
---
title: Gothic
prefix: ourtober-2023
unlisted: true
---
<span class="preserveCase"/>
<span class="preserveSpace"/>
Behind bold figures
A quiet, jealous watcher
Afraid to stand out

@ -0,0 +1,24 @@
---
title: Opportunities
prefix: ourtober-2023
unlisted: true
---
<span class="preserveCase"/>
<span class="preserveSpace"/>
In the twilight tail of life
Regret stabbing like a knife
At the end of mortal strife
Squandered out of fear
Think upon the beaten path
Moments one refrained to laugh
Notes marked down in life's great staff
That we didn't hear
When we leave this world alone
Will we be remembered, known?
Will we leave but crumbled bone
To those we hold dear

@ -0,0 +1,29 @@
---
title: Bleed
prefix: ourtober-2023
unlisted: true
---
<span class="preserveCase"/>
<span class="preserveSpace"/>
An open wound
Festering, torn
The pains of trauma
We now mourn
Carried long
Without relief
Long-past buried
Signs of grief
Now our life
Returns to pain
Remembering how
To bleed again
We yet not flinch
Or shrink or both
These are pains
Of change — of growth

@ -0,0 +1,13 @@
---
title: Cirrus
prefix: ourtober-2023
unlisted: true
---
<span class="preserveCase"/>
<span class="preserveSpace"/>
Icy needle storm
Aimlessly thrown to the ground
Never touching down

@ -1 +1 @@
Subproject commit d39a1029e2a79c13795281ab2b6953618ed6bdc2
Subproject commit cdb45dc23bc97f2aed59b2382562f1733e76ed61

@ -10,6 +10,7 @@ export function encryptPost(password : string, passwordHint : string, post : Une
date: post.date,
title: post.title,
path: post.path,
prefix: post.prefix,
unlisted: post.unlisted,
tags: post.tags,
passwordHint,
@ -27,8 +28,9 @@ export function decryptPost(password: string, post : EncryptedPost) : Unencrypte
date: post.date,
title: post.title,
path: post.path,
prefix: post.prefix,
unlisted: post.unlisted,
tags: post.tags,
body
}
}
}

@ -15,7 +15,11 @@ export async function getRawPosts() : Promise<PostFile[]> {
const parsedPosts : PostFile[] = await Promise.all(files.map(async ({filename, text}) => {
const tempObj = parseMarkdown(text)
const {date, index, path} = extractDateFromFilename(filename)
const {date, index, path: filePath} = extractDateFromFilename(filename)
let path = [filePath]
if (tempObj.prefix && typeof tempObj.prefix === 'string')
path = [tempObj.prefix, filePath]
return {
date,
@ -26,6 +30,7 @@ export async function getRawPosts() : Promise<PostFile[]> {
draft: tempObj.draft || false,
title: tempObj.title,
body: tempObj.content || null,
prefix: tempObj.prefix || null,
password: tempObj.password || null,
passwordHint: tempObj.passwordHint || null
}
@ -100,6 +105,7 @@ export async function resolvePostType(postFile : PostFile) : Promise<Post> {
path: postFile.path,
body: postFile.body || null,
tags: postFile.tags,
prefix: postFile.prefix,
unlisted: postFile.unlisted
}
@ -168,4 +174,4 @@ async function processImage(imageData : BaseImage, thumbnailWidth : number = 600
thumbnailHeight: thumbnail.height,
thumbnailWidth: thumbnail.width
}
}
}

@ -24,10 +24,18 @@
.contentContainer .preserveCase ~ p,
.contentContainer .preserveCase ~ blockquote,
.contentContainer .preserveCase ~ ol,
.contentContainer .preserveCase ~ ul,
.preserveCase {
text-transform: initial;
}
.contentContainer .preserveSpace ~ p,
.contentContainer .preserveSpace ~ blockquote,
.preserveSpace {
white-space: pre;
}
.contentContainer p > code {
padding: 1px 4px;
position: relative;

@ -1,7 +1,8 @@
interface PostCore {
date: string,
title: string,
path: string,
path: string[],
prefix?: string,
unlisted: boolean,
tags: string[]
}
@ -29,4 +30,4 @@ export function postIsEncrypted(post : Post) : post is EncryptedPost {
}
type Post = EncryptedPost | UnencryptedPost
export default Post
export default Post

Loading…
Cancel
Save