Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions workspace/apex/src/lib/components/Badge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
git: ['#f54d27', '#413932'],
github: ['#24292e', Contrast.LIGHT],
html: ['#e34c26', Contrast.LIGHT],
introspection: ['#4caf50', Contrast.LIGHT],
javascript: ['#f7df1e', Contrast.DARK],
life: ['#4caf50', Contrast.LIGHT],
lighthouse: ['#304ffe', Contrast.LIGHT],
Expand Down
5 changes: 3 additions & 2 deletions workspace/apex/src/lib/components/Piece.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { hydrate } from 'aubade/browser';
import { date } from 'mauss';
import { navigating } from '$app/state';
import { phrase } from '$lib/prose';

type Base = Items['/curated' | '/posts' | '/reviews'][number];
type Article = Overwrite<IntersectUnion<Base>, { branches?: string[] }>;
Expand All @@ -27,11 +28,11 @@
<header>
<aside>
{#if post.theme}
<span>a{post.theme === 'essay' ? 'n' : ''} {post.theme}</span>
<span>{phrase(post.theme)}</span>
{#if post.theme !== 'essay' && post.theme !== 'reflection'}
<time datetime={post.date}>{date(post.date).format('DD MMMM YYYY')}</time>
{/if}
{:else if post.series?.title === 'The Harvest'}
{:else if post.series?.title === 'Harvest'}
<time datetime={post.date}>{date(post.date).format('DD MMMM YYYY')}</time>
{/if}

Expand Down
2 changes: 1 addition & 1 deletion workspace/apex/src/lib/components/bits/SeriesList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<a href="/{root}/{link}" class:current={slug === link}>
{#if chapter}
<span>{chapter}</span>
<span class="separator">❃</span>
<span style:color="var(--color-accent-secondary)">❃</span>
{/if}
<span>{title}</span>
</a>
Expand Down
16 changes: 16 additions & 0 deletions workspace/apex/src/lib/prose.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
import type { IntersectUnion, Overwrite } from 'mauss/typings';
import type { Items } from '$content/builder';
import { engrave } from 'aubade/artisan';

type Base = Items['/curated' | '/posts' | '/reviews'][number];
type Article = Overwrite<IntersectUnion<Base>, { branches?: string[] }>;

export function phrase(theme: Article['theme']) {
switch (theme) {
case 'essay':
return 'an essay';
case 'archive':
return 'archived';
default:
return `a ${theme}`;
}
}

export function write(...texts: string[]): string {
return engrave(texts.join('\n')).html();
}
36 changes: 29 additions & 7 deletions workspace/apex/src/lib/server/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,30 @@
blurb: string;
date?: string;
footer?: string;
series?: {
title: string;
chapter?: string;
};
}
const { title, blurb, date, footer = '« mauss.dev »' }: Props = $props();
const { title, blurb, date, footer = '« mauss.dev »', series }: Props = $props();
const count = (text: string) => text.split(' ').length;
</script>

<div>
<section>
{#if series}
<header>
<span>{series.title}</span>
{#if series.chapter}
<span style:color="#d79628">❃</span>
<span>Chapter {series.chapter}</span>
{/if}
</header>
{/if}

<h1 class:balance={count(title) > 1}>{title}</h1>
<p class:balance={count(blurb) > 1}>{blurb}</p>

{#if date}
<footer>
<span>Alkamauss</span>
Expand Down Expand Up @@ -43,6 +58,7 @@
width: 100%;
height: 100%;
display: flex;
gap: 0.5rem;
flex-direction: column;
align-items: center;
justify-content: center;
Expand All @@ -53,27 +69,33 @@
}

h1 {
margin-top: auto;
font-size: 6rem;
}

p {
margin: 0.5rem 0 auto 0;
line-height: 1.25;
font-size: 2rem;
}

header,
footer {
position: absolute;
bottom: -0.2rem;
display: flex;
gap: 0.5rem;
padding: 0 1rem;
gap: 0.8rem;
padding: 0 1.6rem;
align-items: center;
background: #050609;
color: #c2c4cb;
font-size: 1.8rem;
}
header {
top: -0.2rem;
transform: translateY(-50%);
font-size: 2.4rem;
}
footer {
bottom: -0.2rem;
transform: translateY(50%);
font-size: 1.8rem;
}

.balance {
Expand Down
16 changes: 6 additions & 10 deletions workspace/apex/src/routes/content/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,12 @@ export const ROUTES = {
define(({ optional, array, literal, string }) => ({
updated: optional(string()),
date: string(),
theme: optional(
literal(
'reflection', // personal thoughts or reflections on a topic
'essay', // opinionated long-form exploration of a subject
'guide', // practical instructions or how-to
'moment', // brief observation or thought, short or small insight
'archive', // republishing or preserving content for reference
'pending', // unassigned or awaiting categorization
),
'pending',
theme: literal(
'reflection', // personal thoughts or reflections on a topic
'essay', // opinionated long-form exploration of a subject
'guide', // practical instructions or how-to
'moment', // brief observation or thought, short or small insight
'archive', // republishing or preserving content for reference
),
title: string(typography),
series: optional({
Expand Down
5 changes: 1 addition & 4 deletions workspace/apex/src/routes/content/curated.json/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ export async function GET() {
map[series.title].push({ slug, title, chapter: series.chapter || '' });
}
for (const key in map) {
map[key].sort((x, y) => {
if (key === 'The Harvest') return y.slug.localeCompare(x.slug);
return x.chapter.localeCompare(y.chapter) || x.title.localeCompare(y.title);
});
map[key].sort((x, y) => x.chapter.localeCompare(y.chapter) || x.title.localeCompare(y.title));
}

return json({
Expand Down
3 changes: 1 addition & 2 deletions workspace/apex/src/routes/content/posts.json/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function GET() {
map[series.title].push({ slug, title, chapter: series.chapter || '' });
}
for (const key in map) {
map[key].sort((a, b) => a.chapter.localeCompare(b.chapter) || a.title.localeCompare(b.title));
map[key].sort((x, y) => x.chapter.localeCompare(y.chapter) || x.title.localeCompare(y.title));
}

return json({
Expand All @@ -40,7 +40,6 @@ export async function GET() {
['guide', 'Guide'],
['moment', 'Moment'],
['archive', 'Archive'],
['pending', 'Pending'],
],
tags: [...new Set(items.flatMap((p) => p.tags))].filter((t) => t).sort(),
sort_by: [
Expand Down
7 changes: 3 additions & 4 deletions workspace/apex/src/routes/posts/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { scale } from 'svelte/transition';
import { pushState, replaceState } from '$app/navigation';
import { page } from '$app/state';
import { phrase } from '$lib/prose';
import worker from './search.agent?worker&url';

const { data } = $props();
Expand Down Expand Up @@ -104,10 +105,8 @@
<Image ratio={9 / 16} src={post.thumbnail || ''} alt={post.title}>
<div class="canvas" class:overlay={post.thumbnail}>
<aside>
<span>{phrase(post.theme)}</span>
<time datetime={post.date}>{date(post.date).format('DD MMMM YYYY')}</time>
{#if post.theme && post.theme !== 'pending'}
<span style:text-transform="capitalize">{post.theme}</span>
{/if}
</aside>
<header>{post.title}</header>
<small style:line-height="1.5">{post.description || ''}</small>
Expand Down Expand Up @@ -193,7 +192,7 @@
border-radius: var(--rounding-box);
font-size: var(--size-small);

span::before {
time::before {
content: '❃';
color: var(--color-accent-secondary);
margin-right: 0.5rem;
Expand Down
2 changes: 1 addition & 1 deletion workspace/apex/src/routes/posts/[slug]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function load({ parent, params }) {
collection: series,
meta: {
canonical: `/posts/${content.slug}`,
title: content.title,
title: (content.series ? `${content.series.title} • ` : '') + content.title,
description: content.description || '',
image: `https://mauss.dev/posts/${content.slug}/card.png`,
},
Expand Down
1 change: 1 addition & 0 deletions workspace/apex/src/routes/posts/[slug]/card.png/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export async function GET({ fetch, params }) {
title: post.title,
blurb: post.description || formatted,
date: post.description && formatted,
series: post.series,
});
}
4 changes: 2 additions & 2 deletions workspace/content/routes/curated/harvest-2020.10/+article.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ An epic showdown and ending to the Animator vs. Animation saga, watch the final

## headlines

### One-Hundredth of a Light-Year Across the Milky Way
### One-Hundredth of a Light-Year Away

This month marks another completed revolution for me. This time, I felt the need to make a special post to commemorate it. It's in my best interest to make this as general as possible, so that all of the readers would still understand and get my point. I do reserve the last section for everyone that's been involved in my life, one way or another.

see: [article](/posts/one-hundredth-of-a-light-year-across-the-milky-way)
see: [article](/posts/hundredth-light-year)

### Minecraft caves and cliffs update announced

Expand Down
Loading