Skip to content

Commit 2d1051a

Browse files
Add (DRAFT) feature and 'Day 27' draft
1 parent 00756b3 commit 2d1051a

File tree

3 files changed

+78
-9
lines changed

3 files changed

+78
-9
lines changed

content/devlog/2023-03-11.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## (DRAFT) Day 27: Design day
2+
3+
### **Jeroen**, March 11, 2023
4+
5+
Wait what's up!?
6+
A _weekend_ devlog?
7+
That's a first!
8+
9+
Let me explain.
10+
11+
Week 10 started with an [XXL post on Day 22](#post-2023-03-06).
12+
I set three strict goals to achieve for the day.
13+
But I still get distracted by other ideas.
14+
Things to procrastinate with.
15+
So I needed a solution for that.
16+
17+
I already started a markdown-formatted list of ideas and to-do's on that day.
18+
But I had no great way to keep those notes.
19+
So on [Day 23](#post-2023-03-07) I decided to stash them into this blogpost.
20+
That means the weekend blogpost has been written mostly during the rest of the week.
21+
22+
I'm not sure yet if I'll keep the list of ideas below in my blogpost.
23+
Most likely I'll reorganize that in the weekend or thereabouts.
24+
Maybe GitHub issues will be a decent place for these things?
25+
Who knows.
26+
For now I need a dumping ground.
27+
28+
#### Parked ideas and to-do's
29+
30+
So here's a big list of ideas that came up recently:
31+
32+
- **Ideas for Pincrediball.com**
33+
- **Dynamic header levels in Markdown**.
34+
The blog posts _should_ have a `h1` level title.
35+
This way if I ever create individual blog post pages they'll neatly get a `h1`.
36+
And for `/devlog` where all posts sit on one page, they can be dynamically changed.
37+
(The markdown plugin allows for overriding the header rendering methods.)
38+
- **Improve headers setup**.
39+
Additionally, the headers need tweaking.
40+
First, the author + date line doesn't need to be a header.
41+
It can be just an emphasized paragraph.
42+
That way all subsequent headers can be bumped one level.
43+
Which makes more sense and is thus good for accessibility.
44+
Additionally, the `prose` styles will turn out nicer.
45+
- **Bookmark organization**.
46+
All my researched bookmarks are in one big dumping folder.
47+
At the least I should organize them so I can find stuff more easily.
48+
In addition it might be fun to move the interesting ones straight onto the website.
49+
- **Terminology infographic**.
50+
It was hard to find a good visual aid for all Pinball terms.
51+
Creating one myself would be fun and useful.
52+
- **YouTube uploads**.
53+
It might be fun to turn some of the prototype videos into some initial content for the YouTube channel?
54+
Might be better than a completely empty space, also to avoid Google from nullifying the channel.
55+
(The videos would need some kind of background music though, or else it's _too_ boring.)
56+
- **Chase SvelteHack organizers**.
57+
Emailed the organizers of [hack.sveltesociety.dev](https://hack.sveltesociety.dev/) a while ago.
58+
Asked if my projects would qualify, since some light work was done _before_ the official start date.
59+
Never got a reply, so might be nice to chase that?
60+
(Although if I go with Godot, the game might be less integrated with the website than what'd be nice for the hackathon.)
61+
62+
All those ideas needed to be parked in favor of the three main goals.

src/routes/devlog/+page.server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function getTitle(content: string) {
1212

1313
export type Post = {
1414
id: string;
15+
isDraft: boolean;
1516
date: Date;
1617
title: string;
1718
content: string;
@@ -29,8 +30,10 @@ function getPosts(): Post[] {
2930
const date = new Date(`${dateString}T00:00:00.000Z`);
3031
const content = readFileSync(`content/devlog/${file}`, 'utf-8');
3132
const title = getTitle(content);
33+
const isDraft = title.includes('(DRAFT)');
3234
return {
3335
id,
36+
isDraft,
3437
date,
3538
title,
3639
content,

src/routes/devlog/+page.svelte

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@
2323
<p class="mb-4 text-sm text-amber-500">Latest post:</p>
2424

2525
{#each data.posts as post, idx}
26-
<article id={post.id} class="scroll-mt-24 prose prose-invert max-w-none">
27-
{@html marked(post.content)}
28-
</article>
29-
{#if idx === 0}
30-
<hr class="my-8 border-t border-t-amber-400/50" />
31-
<p class="mb-8 text-sm text-amber-500">Older posts:</p>
32-
{:else}
33-
<hr class="my-8 border-t border-t-amber-400/25" />
26+
{#if !post.isDraft}
27+
<article id={post.id} class="scroll-mt-24 prose prose-invert max-w-none">
28+
{@html marked(post.content)}
29+
</article>
30+
{#if idx === 0}
31+
<hr class="my-8 border-t border-t-amber-400/50" />
32+
<p class="mb-8 text-sm text-amber-500">Older posts:</p>
33+
{:else}
34+
<hr class="my-8 border-t border-t-amber-400/25" />
35+
{/if}
3436
{/if}
3537
{/each}
3638
</div>
@@ -44,7 +46,9 @@
4446
{#each data.postsGroupedByWeek as group}
4547
<h3 class="font-bold mt-2">{group.key}</h3>
4648
{#each group.posts as post}
47-
<a class="underline hover:text-amber-500" href={`#${post.id}`}>{post.title}</a>
49+
{#if !post.isDraft}
50+
<a class="underline hover:text-amber-500" href={`#${post.id}`}>{post.title}</a>
51+
{/if}
4852
{/each}
4953
{/each}
5054
</div>

0 commit comments

Comments
 (0)