Managing FastAPI Projects with Poetry: A Step-by-Step Guide

There are many great platforms these days for starting a technical blog, but most are either paid or require a bit of setup.
That’s why I chose Blogger — it's free, simple, and easy to get started.
However, as a technical blogger, I often need to share things like Linux commands, source code snippets, or terminal outputs — and unfortunately, Blogger doesn't support code blocks natively.
To resolve this, I added a syntax highlighting library called Prism.js to my Blogger theme so that code in my posts looks clean and readable.
<head>
section<head>
tag near the top of the code.<head>
tag:<head>
<meta content='width=device-width, initial-scale=1' name='viewport'/>
<title><data:view.title.escaped/></title>
<!-- Prism CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" rel="stylesheet" />
<!-- Prism JS (Core) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<!-- Language Components -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-java.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-http.min.js"></script>
⚠️ Important: Do not self-close<script>
tags like
<script ... />.
Always use the full format:<script>...</script>
When writing a post, switch to “HTML view” and insert code using the <pre><code>
format like this:
<pre><code class="language-bash">
sudo netplan apply
</code></pre>
<pre><code class="language-java">
System.out.println("Hello, world!");
</code></pre>
<pre><code class="language-python">
def hello():
print("Hello, world!")
</code></pre>
<pre><code class="language-http">
GET /api/users HTTP/1.1
Host: example.com
</code></pre>
If you prefer a dark look for your code blocks, simply swap the CSS link with a different Prism theme:
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-okaidia.min.css" rel="stylesheet" />
Other popular themes include:
prism-dark
See all themes: https://prismjs.com
Comments
Post a Comment