Blog Beautification - Changing the Rendering of Quotes and Code Blocks, Supporting GitHub Alerts
Last updated on April 10, 2026 pm
This article is currently an experimental machine translation and may contain errors. If anything is unclear, please refer to original Chinese version. I am continuously working to improve the translation.
For a long time I've felt that the quotes and code blocks on my blog were hideously ugly, and the lack of support for GitHub Alerts like [!TIPS] was quite annoying. Today I solved these issues one by one.
Solved entirely through Vibe Coding, using Copilot + GPT 5.3 Codex High.
Quote Section
The prompt was roughly to imitate the VitePress style and modify the blockquote part.
The specific file is located at source/css/custom.css, and is imported via custom_css in the theme configuration _config.fluid.yml.
The blockquote changes mainly did three things:
- Adjusted the left accent border;
- Added rounded corners and a background gradient;
- Unified the color variables in dark mode.
For example, the core styles look roughly like this:
:root {
--vp-like-quote-bg: #f5f9ff;
--vp-like-quote-border: #3a8ee6;
}
.markdown-body blockquote {
border-left: 4px solid var(--vp-like-quote-border);
border-radius: 0 10px 10px 0;
background: linear-gradient(90deg, var(--vp-like-quote-bg), transparent);
}Code Block Section
The prompt was similar—imitating the VitePress style, then modifying the styles and the code font.
For the code font, I used this set: JetBrains Mono, Fira Code, Cascadia Code, falling back to common monospace fonts.
The key points of the code block style changes:
- Unified the border, rounded corners, and background color;
- Adjusted the table layout of
figure.highlight; - Ensured the layout doesn't break during horizontal scrolling;
- Kept the line height and spacing consistent between the line number column and the code column.
Key style example:
.markdown-body figure.highlight {
border: 1px solid var(--vp-like-code-border);
border-radius: 12px;
overflow-x: auto;
}
.markdown-body figure.highlight td.gutter pre,
.markdown-body figure.highlight td.code > pre {
line-height: 1.75 !important;
}By LLM:
Regarding code line numbers, I implemented a "double insurance" approach here:
- Configuration layer: set the line number related switches to
falsein both_config.fluid.ymland_config.yml;- Post-rendering processing layer: added
scripts/strip-code-gutter.js, which at theafter_post_renderstage detectsline_number: falseand proactively removestd.gutterfromfigure.highlight.This way, even if some pages still carry a gutter due to historical cache or rendering pipeline differences, it will be stripped out before the final HTML output, ensuring the page appearance is consistent with the configuration.
Handling GitHub Alert Support
I personally don't understand the Markdown parsing process, but while reading the Hexo Fluid Official Documentation, I came across this part:

So I wondered whether it would be possible to parse a format like
> [!TIPS]into a format natively supported by Hexo Fluid?
I fed the above idea to Copilot, and it was written as a JavaScript script scripts\gfm-alert-to-note.js.
Using this mapping:
const ALERT_CLASS_MAP = {
note: 'info',
tip: 'success',
tips: 'success',
important: 'primary',
warning: 'danger',
caution: 'warning'
};The script's approach is actually quite straightforward:
- Get the rendered HTML of the post at
after_post_render; - Use cheerio to find all
blockquoteelements; - Check whether the first line is a marker like
[!NOTE]/[!TIP]; - Convert the type to Fluid's
note-xxxaccording to the mapping table; - Finally, replace the original blockquote with
<div class="note note-xxx">...</div>.
The corresponding implementation file is: scripts/gfm-alert-to-note.js.
Before and After Comparison
Before:


After:


Summary
Actually, today I originally planned to migrate my blog to VitePress (simply because it looks so nice), but I found that I couldn't figure out how to design a suitable file directory structure, or how to properly organize the content, so I've shelved it for now.
Perhaps the next blog update will be "Migrating the Blog to VitePress".