Writing blog posts
Blog posts live in src/content/blog/ in the website repository. Each post is one .md or .mdx file. Use .mdx when you need components such as video.
Front matter
Section titled “Front matter”---title: Reading SunSpec inverters with go-sunspecdescription: One sentence for search results and social cards.date: 2026-10-12authors: [OT Fabric] # one or more namestags: [modbus, sunspec, energy]cover: alt: Rooftop solar array image: ../../assets/blog/sunspec-cover.jpgfeatured: false # pin to the top of the blogdraft: false # true keeps it out of the build---Images
Section titled “Images”Put images in src/assets/blog/ and use relative paths. Astro optimizes them at build time.
Video and callouts
Section titled “Video and callouts”Three components are available in .mdx posts:
import YouTube from '../../components/YouTube.astro';import Video from '../../components/Video.astro';import Callout from '../../components/Callout.astro';
<YouTube id="VIDEO_ID" title="modbusctl scan walkthrough" />
<Callout type="caution" title="Before you write"> Test against a simulator first.</Callout>
<Video src="/videos/scan.mp4" poster="/videos/scan.jpg" caption="An adaptive scan in progress" />Self-hosted files go in public/videos/. Keep them short and compressed; prefer YouTube for anything longer than a minute.
Fenced code blocks are highlighted with Expressive Code. Add a title, mark lines, or show a terminal frame:
```go title="main.go" {3}regs, err := client.ReadRegisters(ctx, 1, 100, 4, modbus.HoldingRegister)if err != nil { log.Fatal(err)}```
```sh frame="terminal"modbusctl client poll --ip 192.168.1.10 --start 100 --count 4```