blogging with markdown, again

Published at 2024/08/03

#svelte#markdown

Here’s the original post - but since it is updated, I’m making a new document.link

Getting svelte and Markdown to work for this blog

When I started to make this website, I wanted to have the simple ability to write posts in markdown, and have those posts get appropriately formatted. So, I added it with a package called “svelte-markdown.”

// code example goes here

This text should be a header level two.

This is a paragraph.

  • This is a list
  • With two items
  1. And a sublist
  2. That is ordered
    • With another
    • Sublist inside

some markdown (with two stars) content is ~odd (squigglies)~

And this is A table
With two columns

2024/08/03 - a new set of tools

I’m following a new blog post in order to make this blog easier for me. So instead of using just svelte-markdown, I’d like to do a little more. I want my blog post creation process to be just making .md files, maybe with some relevant information automatically filled into the svelte page (or layout). For this, I’d like to use a preprocessor, to populate fields like “title” directly from the markdown.

I guess one thing that I have to add, is the testing component. I will start with a PostList component - something I already have, but it doesn’t quite work yet. I add a test to check if the title of this post shows up in the Post List - which it should.

that spec looks like this:

import PostList from '../src/routes/blog/PostList.svelte'
import { render, screen } from '@testing-library/svelte';

describe("PostList component", () => {
    test("should render the component"), () => {
        // render the component
        render(PostList);
        // find the component
        const instance = screen.getByText(/each post/i);
        expect(instance).toBeTruthy();
    };
});

so now, I’ll add the test. The title of the post is “blogging with markdown, again” - so let’s check for it in the PostList component.

const instance2 = screen.getByText(/blogging with markdown, again/i)```

No Last Words © 2025