diff --git a/index.html b/index.html index 2750a29..73df5ec 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,8 @@ + + SecCodeSmith - Code Forged in Digital Fire diff --git a/src/assets/styles/BlogPost.module.scss b/src/assets/styles/BlogPost.module.scss index b0be63d..bc73265 100644 --- a/src/assets/styles/BlogPost.module.scss +++ b/src/assets/styles/BlogPost.module.scss @@ -142,7 +142,6 @@ .postContent a { color: $accent-fire; text-decoration: none; - border-bottom: 1px dotted $accent-fire; transition: all 0.3s ease; } @@ -439,7 +438,7 @@ border: 1px solid $card-border; border-radius: 4px; padding: 12px 15px; - color: $text-light; + color: $text-light !important; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; resize: vertical; transition: all 0.3s ease; diff --git a/src/data/blogPostsData.ts b/src/data/blogPostsData.ts index 358f161..98e3683 100644 --- a/src/data/blogPostsData.ts +++ b/src/data/blogPostsData.ts @@ -15,19 +15,17 @@ export const blogPostsData: BlogPostProps[] = [ featured: true, tags: ["STM32", "Embedded", "IoT", "Communication Protocols"], content: ` -

In the digital forge where hardware meets software, the STM32 microcontroller family stands as a powerful conduit for summoning digital entities into our physical realm. Today, we shall delve into advanced techniques for establishing robust communication between these entities through the mystical arts of embedded systems programming.

+ In the digital forge where hardware meets software, the STM32 microcontroller family stands as a powerful conduit for summoning digital entities into our physical realm. Today, we shall delve into advanced techniques for establishing robust communication between these entities through the mystical arts of embedded systems programming. -

The realm of IoT demands reliable, efficient communication protocols that can withstand the chaotic nature of real-world environments. Through careful implementation and optimization of the STM32's communication peripherals, we can craft resilient connections that bridge the gap between digital and physical domains.

+ The realm of IoT demands reliable, efficient communication protocols that can withstand the chaotic nature of real-world environments. Through careful implementation and optimization of the STM32's communication peripherals, we can craft resilient connections that bridge the gap between digital and physical domains. -

The Three Elemental Protocols: I2C, SPI, and UART

+ ## The Three Elemental Protocols: I2C, SPI, and UART -

Before we forge ahead into advanced territory, let us briefly recall the elemental forces at our disposal. Each protocol serves as a channel through which our digital entities communicate, each with its unique strengths and limitations:

- - + Before we forge ahead into advanced territory, let us briefly recall the elemental forces at our disposal. Each protocol serves as a channel through which our digital entities communicate, each with its unique strengths and limitations: + * **I2C (Inter-Integrated Circuit)** - A two-wire interface requiring minimal physical connections, ideal for communication with multiple peripheral devices over short distances. + * **SPI (Serial Peripheral Interface)** - A faster, full-duplex protocol with dedicated select lines for each peripheral, allowing simultaneous transmission and reception of data. + * **UART (Universal Asynchronous Receiver-Transmitter)** - A simple two-wire asynchronous interface, perfect for direct device-to-device communication without a shared clock. + ` }, { diff --git a/src/pages/BlogPost.tsx b/src/pages/BlogPost.tsx index 4209cce..f5cc3cd 100644 --- a/src/pages/BlogPost.tsx +++ b/src/pages/BlogPost.tsx @@ -6,6 +6,22 @@ import { NotFound } from './NotFound'; import style from '@styles/BlogPost.module.scss'; +function dedent(str: string): string { + const lines = str.split('\n'); + while (lines.length > 0 && lines[0].trim() === '') { + lines.shift(); + } + while (lines.length > 0 && lines[lines.length - 1].trim() === '') { + lines.pop(); + } + + const indents = lines + .filter(line => line.trim().length > 0) + .map(line => line.match(/^ */)![0].length); + const minIndent = indents.length ? Math.min(...indents) : 0; + + return lines.map(line => line.slice(minIndent)).join('\n'); +} export const BlogPost = () => { const { slug } = useParams<{ slug: string }>(); @@ -13,14 +29,12 @@ export const BlogPost = () => { const [relatedPosts, setRelatedPosts] = useState(blogPostsData.slice(0, 3)); useEffect(() => { - // Find the post by slug const currentPost = blogPostsData.find(post => post.slug === slug); - + if (currentPost) { - // Set the post setPost(currentPost); - // Find related posts (same category or shared tags) + const related = blogPostsData .filter(p => p.id !== currentPost.id) .filter(p => @@ -31,7 +45,6 @@ export const BlogPost = () => { setRelatedPosts(related); - // Scroll to top when new post is loaded window.scrollTo(0, 0); } }, [slug]); @@ -134,14 +147,14 @@ export const BlogPost = () => {
- +
- +
- +
@@ -151,25 +164,25 @@ export const BlogPost = () => { -