From cc4608fbf504fe2b1c05336a6246c7d82c2ae33b Mon Sep 17 00:00:00 2001 From: EFEELE Date: Wed, 30 Apr 2025 16:09:42 -0600 Subject: [PATCH] refactor(MarkdownPostLayout): clean up code formatting and improve layout structure - Removed unnecessary whitespace for better readability. - Wrapped ListPosts component in a div for improved layout consistency. --- src/layouts/MarkdownPostLayout.astro | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/layouts/MarkdownPostLayout.astro b/src/layouts/MarkdownPostLayout.astro index bc9a6e3..870b374 100644 --- a/src/layouts/MarkdownPostLayout.astro +++ b/src/layouts/MarkdownPostLayout.astro @@ -11,7 +11,7 @@ import Share from "../components/ui/Share.astro"; const { frontmatter } = Astro.props; const currentUrl = `${Astro.site}${Astro.url.pathname}`; const tweetText = encodeURIComponent( - `"${frontmatter.title}" - by ${frontmatter.author} | EFEELE`, + `"${frontmatter.title}" - by ${frontmatter.author} | EFEELE` ); import Heading from "../components/ui/Heading.astro"; --- @@ -29,12 +29,12 @@ import Heading from "../components/ui/Heading.astro"; copyButton.innerHTML = copyButtonLabel; codeBlock.setAttribute("tabindex", "0"); - + // wrap codeblock with relative parent element if (codeBlock.parentNode) { codeBlock.parentNode.insertBefore(wrapper, codeBlock); wrapper.appendChild(codeBlock); - + // Add the copy button to the wrapper instead of the codeBlock // This ensures the button stays fixed relative to the code block container wrapper.appendChild(copyButton); @@ -48,7 +48,7 @@ import Heading from "../components/ui/Heading.astro"; async function copyCode(block: HTMLElement, button: HTMLButtonElement) { let code = block.querySelector("code"); if (!code) return; - + let text = code.innerText; await navigator.clipboard.writeText(text); @@ -72,7 +72,7 @@ import Heading from "../components/ui/Heading.astro"; >
@@ -122,7 +122,7 @@ import Heading from "../components/ui/Heading.astro"; } -
+
@@ -136,7 +136,8 @@ import Heading from "../components/ui/Heading.astro";
- - +
+ +