+
diff --git a/src/components/astro/blog.astro b/src/components/astro/recent-blogs.astro
similarity index 100%
rename from src/components/astro/blog.astro
rename to src/components/astro/recent-blogs.astro
diff --git a/src/components/astro/tag.astro b/src/components/astro/tag.astro
index 8e7f9e4..ec4dfda 100644
--- a/src/components/astro/tag.astro
+++ b/src/components/astro/tag.astro
@@ -17,24 +17,22 @@ const filteredPosts = posts.filter((post: any) => post.data.tags?.includes(tag))
---
-
-
#{tag}
+
#{tag}
- {
- filteredPosts.length > 0 ? (
-
- {filteredPosts.map((post: any) => (
-
- ))}
-
- ) : (
-
{t("tag.no_posts")}
- )
- }
-
+ {
+ filteredPosts.length > 0 ? (
+
+ {filteredPosts.map((post: any) => (
+
+ ))}
+
+ ) : (
+ {t("tag.no_posts")}
+ )
+ }
diff --git a/src/components/react/code-background.tsx b/src/components/react/code-background.tsx
deleted file mode 100644
index c9dd968..0000000
--- a/src/components/react/code-background.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import { useEffect, useState } from "react"
-
-export function CodeBackground() {
- const charGroups = {
- brackets: {
- chars: ["{", "}", "(", ")", "[", "]", "<", ">"],
- weight: 3,
- },
- operators: {
- chars: ["=", "+", "-", "*", "/", "%", "=>", "&&", "||", "|", "&", "..."],
- weight: 2,
- },
- punctuation: {
- chars: [".", ";", ":", ","],
- weight: 4,
- },
- keywords: {
- chars: [
- "const",
- "let",
- "var",
- "function",
- "if",
- "else",
- "return",
- "class",
- "import",
- "export",
- "from",
- "async",
- "await",
- "try",
- "catch",
- "interface",
- "type",
- "extends",
- "implements",
- ],
- weight: 1,
- },
- values: {
- chars: ["null", "undefined", "true", "false", "void", "any", "never"],
- weight: 1,
- },
- }
-
- const [backgroundChars, setBackgroundChars] = useState
([])
-
- useEffect(() => {
- const getWeightedRandomChar = () => {
- const weightedChars = Object.values(charGroups).reduce((acc, group) => {
- const chars = Array(group.weight).fill(group.chars).flat()
- return [...acc, ...chars]
- }, [] as string[])
- return weightedChars[Math.floor(Math.random() * weightedChars.length)]
- }
-
- const chars = new Array(2000).fill(null).map(() => getWeightedRandomChar())
- setBackgroundChars(chars)
- }, [])
-
- return (
-
- {backgroundChars.map((char, index) => (
-
- {char}
-
- ))}
-
- )
-}
diff --git a/src/layouts/base.astro b/src/layouts/base.astro
index 3d71f4c..4582ea6 100644
--- a/src/layouts/base.astro
+++ b/src/layouts/base.astro
@@ -1,7 +1,6 @@
---
import "~/styles/globals.css"
import { NoiseBackground } from "~/components/react/noise-background"
-import { CodeBackground } from "~/components/react/code-background"
import { getLangFromUrl } from "~/i18n/utils"
import { GoogleAnalytics } from "astro-google-analytics"
import { en, zh } from "~/config"
@@ -85,6 +84,5 @@ const config = lang === "zh" ? zh : en
>
-