diff --git a/src/components/Posts/PostItem.astro b/src/components/Posts/PostItem.astro index f81c360..ddda3ae 100644 --- a/src/components/Posts/PostItem.astro +++ b/src/components/Posts/PostItem.astro @@ -1,6 +1,7 @@ --- import "@/styles/global.css"; import Remark42Counter from "@/components/Remark42Counter.astro"; +import TagLink from "@/components/TagLink.astro"; import { getLangFromUrl } from "@/i18n"; const lang = getLangFromUrl(Astro.url); @@ -22,9 +23,7 @@ const tags = data.tags;
@@ -51,81 +50,31 @@ const tags = data.tags; - - diff --git a/src/components/Posts/PostList.astro b/src/components/Posts/PostList.astro index 43cd00f..85bdada 100644 --- a/src/components/Posts/PostList.astro +++ b/src/components/Posts/PostList.astro @@ -59,15 +59,15 @@ const latestPosts = filteredPosts.slice(0, 7); } .more-link-wrap { - margin-top: 1rem; + margin-top: 2rem; text-align: right; } .more-link { color: #6f8090; - font-weight: 700; + font-weight: 400; text-decoration: none; - font-size: 1.14rem; + font-size: 0.9rem; } .more-link:hover { diff --git a/src/components/TagLink.astro b/src/components/TagLink.astro new file mode 100644 index 0000000..767ad33 --- /dev/null +++ b/src/components/TagLink.astro @@ -0,0 +1,48 @@ +--- +interface Props { + tag: string; + lang: string; +} + +const { tag, lang } = Astro.props; +--- + +#{tag} + + diff --git a/src/layouts/MarkdownPostLayout.astro b/src/layouts/MarkdownPostLayout.astro index 731c07f..4ad5071 100644 --- a/src/layouts/MarkdownPostLayout.astro +++ b/src/layouts/MarkdownPostLayout.astro @@ -2,6 +2,7 @@ import BaseLayout from "./BaseLayout.astro"; import Remark42Embed from "@/components/Remark42Embed.astro"; import PostNav from "@/components/Posts/PostNav.astro"; +import TagLink from "@/components/TagLink.astro"; import PostMenu from "@/components/Posts/PostMenu.astro"; import Dialog from "@/components/Posts/Dialog.astro"; import { fade } from "astro:transitions"; @@ -61,9 +62,7 @@ const t = getTranslations(lang); @@ -317,8 +316,6 @@ const t = getTranslations(lang); aspect-ratio: 16 / 10; object-fit: cover; object-position: center; - /* border-radius: 0.4rem; */ - border: 1.5px #94a0ab dashed; display: block; } @@ -334,42 +331,13 @@ const t = getTranslations(lang); .tags { display: flex; flex-wrap: wrap; - gap: 0.4rem; + gap: 0.25rem 0.9rem; margin-top: 0.8rem; min-width: 0; - } - - .tag { - margin: 0; - padding: 0.22em 0.65em; font-size: 0.88rem; - line-height: 1.2; - border: 1px dashed #8b6b4a; - border-radius: 0; - background-color: transparent; - max-width: 100%; } - .tag a { - color: #6f4e37; - text-decoration: none; - overflow-wrap: anywhere; - word-break: break-word; - } - - .tag a:hover { - text-decoration: underline; - } - - :global(.dark) .tag { - border-color: #d8c7a1; - } - - :global(.dark) .tag a { - color: #e6d8b8; - } - - @media (max-width: 560px) { + @media (max-width: 800px) { .post-header { grid-template-columns: 1fr; } diff --git a/src/pages/[lang]/index.astro b/src/pages/[lang]/index.astro index 05532c0..c8db2bb 100644 --- a/src/pages/[lang]/index.astro +++ b/src/pages/[lang]/index.astro @@ -49,7 +49,7 @@ const rssLink = lang === "zh" ? "/rss.xml" : "/en/rss.xml"; -
- {tag}
+