Last updated: 2025-11-22
We refactored the blog post rendering pipeline to make MDX the single source of truth for titles, structure, and rich content styling.
- Removed hard‑coded
<h1>/<h2>title + subtitle injection. MDX now supplies its own heading hierarchy (you should include an H1 at the top of the MDX file). - Added a lightweight header section that only shows author avatar/initial, name, reading time, and date.
- Wrapped article content in a semantic container:
<div class="prose prose-lg max-w-none mdx-article-content">instead of a long chain of utility classes. - Introduced GitHub‑flavored Markdown (GFM) and syntax highlighting via:
remark-gfm(tables, strikethrough, task lists, autolinks)rehype-prism-plus(code block highlighting + inline diff support, optional line highlighting)
- Added resilient fallback serialization (try/catch) so a plugin failure doesn’t break the build.
- Implemented comprehensive custom styles in
styles/globals.cssunder the.mdx-article-contentnamespace (headings, lists, ordered counters, code blocks, inline code, blockquotes, tables, images, horizontal rules).
getPostData(slug)reads MDX fromblogposts/<slug>.mdx.- Gray‑matter parses frontmatter (metadata) and strips it from content.
- Content goes through
serialize()withremark-gfmandrehype-prism-plus. - Page component receives
mdxSource, passes it to<MDXRemote />. - Styling applied via Tailwind typography base + our extended CSS rules.
All blog articles live in blogposts/ and use the .mdx extension.
At minimum include these fields:
---
title: "Your Post Title"
subtitle: "Optional descriptive subtitle"
date: "2025-11-22" # ISO format recommended (YYYY-MM-DD)
image: "/images/optional-cover.png" # (optional) used for listing card
---Optional extra fields you can add (supported but not yet consumed everywhere):
tags: [telemetry, linux, windows]
author: "Override Name" # Defaults to Kostas if omitted- Start the document with a single
# H1matching the frontmatter title OR a refined version of it. - Use
##for major sections;###/####for nested subsections. - Avoid skipping levels (e.g., don’t jump from
##directly to####). - Keep heading text concise; rely on paragraphs for detail.
- A blank line between paragraphs is enough; extra
<br />tags are unnecessary. - Emphasis:
*italic*,**bold**,***bold italic***.
Unordered:
- First point
- Second point with **emphasis**
- Nested detailOrdered:
1. Step one
2. Step two
1. Sub-step A
2. Sub-step BOur CSS transforms bullets into blue filled circles and ordered indices into numbered badges—no need to customize manually.
Use backticks for short identifiers:
`sysmon` or `/var/log/auth.log`.
Avoid wrapping entire paragraphs—prefer fenced code blocks.
Use fenced blocks with a language identifier for highlighting:
sudo auditctl -w /etc/passwd -p wa -k passwd_changesimport os
print(os.getenv("HOME"))Supported Prism languages include: bash, sh, powershell, python, json, yaml, javascript/ts, diff, docker, markdown, etc. If a language isn’t recognized it will still render, just without token colors.
You can highlight specific lines using Prism’s diff or by applying inline marks:
+ Added important logic
- Removed insecure callUse > for callouts:
> Important: Enable Auditd before configuring process execution rules.They render with a left border + subtle gradient background.
GitHub‑flavored Markdown enables pipe tables:
| Event ID | Meaning | Platform |
|----------|------------------------|----------|
| 4624 | Successful logon | Windows |
| 4688 | Process creation | Windows |Keep tables narrow—avoid excessive columns. For large datasets consider linking to a dedicated comparison page.
They will get rounded corners + shadow automatically. Prefer compressed .webp or .png when practical.
Use --- to create a thematic break between major sections.
We currently rely on blockquotes for notes. If richer admonitions are desired (e.g., Tip, Warning) we can later add a remark plugin (proposed: remark-directive).
| Element | Behavior / Styling Summary |
|---|---|
| Headings | Scaled, negative letter-spacing for optical alignment |
| Bulleted list | Custom blue circular bullets w/ subtle outer glow |
| Ordered list | Blue circular numbered badges (counter reset per list) |
| Inline code | Light badge, mono font, subtle border |
| Code blocks | Dark theme, language label, scrollable horizontal overflow |
| Blockquotes | Left border + gradient + larger readable font |
| Tables | Zebra stripes, subtle borders, styled header background |
| Images | Centered, shadow, rounded corners |
| HR | Wide spacing before/after, light border |
- Aim for paragraphs ≤ 4 lines for readability.
- Prefer active voice and concrete examples.
- Use lists to break up dense conceptual sections.
- Include at least one code block if the topic is technical.
- Always verify paths / commands in a test environment before publishing.
| Pitfall | Fix |
|---|---|
| Missing H1 | Add # Title at top; frontmatter alone no longer injects it. |
| Very long code lines | Add manual line breaks or use backslashes for multiline readability. |
| Table overflow | Reduce columns or abbreviate headers; link to full reference. |
| Inline HTML | Favor Markdown syntax—HTML may bypass styling defaults. |
| Mixed heading depths | Maintain sequential structure (# then ##, then ###). |
- Line numbers for code blocks (via
rehype-prism-plusconfiguration + CSS). - Copy-to-clipboard button overlay on code blocks.
- Admonition directives (remark-directive + custom components).
- MDX components for embedding telemetry comparison snippets.
Copy this into a new file under blogposts/:
---
title: "Post Title"
subtitle: "Short descriptive subtitle"
date: "2025-11-22"
image: "/images/post-title.png"
---
# Post Title
Intro paragraph (2–4 lines) setting context.
## Section One
Explain a concept.
- Key point one
- Key point two
```bash
# Example command
auditctl -w /etc/passwd -p wa -k passwd_changesTip: Keep your Auditd rules documented in version control.
Wrap up and link to further resources.
## 8. Validation Checklist Before Commit
- Frontmatter date correct & consistent format.
- Single H1 present.
- No empty list items.
- Code fences include language identifiers.
- Images compressed & path valid.
- Spellcheck critical terms (telemetry names, event IDs).
## 9. Troubleshooting
| Issue | Cause | Resolution |
|-------|-------|------------|
| No syntax colors | Language not supported or typo | Use valid Prism language id (e.g. `bash`, `python`). |
| Bullets look default | Cached stylesheet | Hard refresh (Cmd+Shift+R) / ensure `.mdx-article-content` styles not overridden. |
| MDX build error | Invalid frontmatter YAML | Validate with an online YAML parser. |
| Title missing | Forgot to add `#` heading | Add H1 at top of file. |
---
For questions or to propose enhancements, open an issue or add a note to the roadmap.