A person with short, thick hair and prescription glasses sits at an organized workstation, using a magnification app to navigate a webpage. Their posture is proper and relaxed. On the desk: a computer, a mouse, a large desk lamp and a small notebook.

# Showing Off Blog Features

4 min read
Table of Contents

Since the post does not have a description in the frontmatter, the first paragraph is used.

ThemingLink to heading

Use your favorite editor theme for your blog!

Theming for the website comes from builtin Shiki themes found in Expressive Code. You can view them here. A website can have one or more themes, defined in src/site.config.ts. There are three theming modes to choose from:

  1. single: Choose a single theme for the website. Simple.
  2. light-dark-auto: Choose two themes for the website to use for light and dark mode. The header will include a button for toggling between light/dark/auto. For example, you could choose github-dark and github-light with a default of "auto" and the user’s experience will match their operating system theme straight away.
  3. select: Choose two or more themes for the website and include a button in the header to change between any of these themes. You could include as many Shiki themes from Expressive Code as you like. Allow users to find their favorite theme!

When the user changes the theme, their preference is stored in localStorage to persist across page navigation.

Code BlocksLink to heading

Let’s look at some code block styles:

def hello_world():
print("Hello, world!")
hello_world()
hello.py
def hello_world():
print("Hello, world!")
hello_world()
Terminal window
python hello.py

Also some inline code: 1 + 2 = 3. Or maybe even (= (+ 1 2) 3).

See the Expressive Code Docs for more information on available features like wrapping text, line highlighting, diffs, etc.

Basic Markdown ElementsLink to heading

  • List item 1
  • List item 2

Bold text

Italic text

Strikethrough text

Link

In life, as in art, some endings are bittersweet. Especially when it comes to love. Sometimes fate throws two lovers together only to rip them apart. Sometimes the hero finally makes the right choice but the timing is all wrong. And, as they say, timing is everything.

- Gossip Girl

NameAgeCity
Alice30New York
Bob25Los Angeles
Charlie35Chicago

ImagesLink to heading

Images can include a title string after the URL to render as a <figure> with a <figcaption>.

Pixel art of a tree
Pixel art renders poorly without proper CSS

Pixel art markdown
![Pixel art of a tree](./PixelatedGreenTreeSide.png 'Pixel art renders poorly without proper CSS')

I’ve also added a special tag for pixel art that adds the correct CSS to render properly. Just add #pixelated to the very end of the alt string.

Pixel art of a tree
But adding #pixelated to the end of the alt string fixes this

Pixel art markdown with #pixelated
![Pixel art of a tree #pixelated](./PixelatedGreenTreeSide.png 'But adding #pixelated to the end of the alt string fixes this')

AdmonitionsLink to heading

Admonition example in markdown
:::note
testing123
:::

Character ChatsLink to heading

Custom character chat
:::duck
**Did you know?** You can easily create custom character chats for your blog with MultiTerm!
:::

Adding Your OwnLink to heading

To add your own character, first add an image file to the top-level /public directory in your cloned MultiTerm repo. Astro cannot automatically optimize image assets from markdown plugins, so make sure to compress the image to a web-friendly size (<100kb).

I recommend Google’s free Squoosh web app for creating super small webp files. The characters here have been resized to 300 pixels wide and exported to webp with 75% quality using Squoosh.

After you’ve added your image, update the characters option in site.config.ts with your newly added image file and restart the development server.

Character ConversationsLink to heading

When there are multiple character chats in a row, the order of the chat image and chat bubble reverses to give the chat more of a back-and-forth appearance.

Sequential character chats
:::owl
This is a cool feature!
:::
:::unicorn
I agree!
:::

GitHub CardsLink to heading

GitHub overview cards heavily inspired by Astro Cactus.

GitHub repo card example in markdown
::github{repo="stelcodes/multiterm-astro"}
A coder-ready Astro blog theme with 60 of your favorite color schemes to choose from 🎨
11921MITAstro
GitHub user card example in markdown
::github{user="withastro"}
3.5K44

Emoji 🤩Link to heading

Emojis can be added in markdown by including a literal emoji character or a GitHub shortcode. You can browse an unofficial database here.

Example markdown with GitHub emoji shortcodes
Good morning! :sleeping: :coffee: :pancakes:

Good morning! 😴 🥞

All emojis (both literal and shortcoded) are made more accessible by wrapping them in a span tag like this:

<span role="img" aria-label="coffee">☕️</span>

At the time of writing, emoji v16 is not supported yet. These emojis can be included literally but they do not have shortcodes and will not be wrapped.

LaTeX/KaTeX Math SupportLink to heading

You can also display inline math via remark-math and rehype-katex.

Rendering pretty math with KaTeX
Make those equations pretty! $ \frac{a}{b} \cdot b = a $

Make those equations pretty! abb=a\frac{a}{b} \cdot b = a

HTML ElementsLink to heading

Fieldset with InputsLink to heading






Form with LabelsLink to heading






My avatar

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.


More Posts

Comments