To Steal An Aesthetic. To Find Beauty in an API.

Beautiful design is addicting to look at. This fact is especially true when the design is brilliantly simple. I first saw https://2pml.com/ on a chilly Saturday morning and the greed to have the same immediately began to bubble and fester.

The Brutally Simple 2pm design language.
A Captivating Footer

If only I was a software developer who wanted to work on his frontend skills. Fortunately, I am a that developer. Moreover, I am that exact developer obsessed with improving his frontend skills. And thus, from these simple truths, The Rat was born.

The Morning

In the morning, I built the page.

The Rat by Thorne Wolf

What elegant edges. What a powerful lightning-yellow button. What a concerning political war being waged by the cats. I do admit, I may have initially included photo of a rat.

tktktktk

The code behind my clone isn't really important. What is important is that I showed myself I could successfully mimic the look of another webpage in a focused morning. What could I do if I added a focused afternoon?

The Afternoon

Someone once told me that Ghost has an API. Surely that API can give me the contents of my articles? What was that? It can!?

Ghost's summary of it's own Content API

I will simply copy-paste the example...

export const GET = (async ({ url }) => {

    const api = new GhostContentAPI({
        url: 'https://XXXXXXXX.ghost.io',
        key: ghostContentApiKey,
        version: "v5.0"
    });

    // fetch 5 posts, including related tags and authors
    let limit = url.searchParams.get('limit') || 6
    let posts = await api.posts.browse({ limit: limit, include: 'tags,authors' })
    posts = posts.map(post => { return { title: post.title, excerpt: post.excerpt, author: post.primary_author.name, authorId: post.primary_author.id, id: post.id, updatedAt: post.updated_at, html: post.html } })
    return json(posts);
}) satisfies RequestHandler;

And it works:

Writing code is so easy.

Subscribe to Thorne Wolfenbarger - Blog

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe