update content width

This commit is contained in:
ClovertaTheTrilobita 2026-09-17 13:35:59 +08:00
parent 566c5fa24a
commit 7c3bbfee42
4 changed files with 151 additions and 138 deletions

View file

@ -165,10 +165,7 @@ const t = getTranslations(lang);
width: var(--site-nav-width, auto);
margin: var(--site-nav-margin, 1rem) 0;
padding-bottom: var(--site-nav-padding, 1rem);
transform: translate(
var(--site-nav-x, 0),
var(--site-nav-y, 0)
);
transform: translate(var(--site-nav-x, 0), var(--site-nav-y, 0));
}
.site-header :global(.site-nav-desktop) {
@ -207,7 +204,6 @@ const t = getTranslations(lang);
font-size: clamp(1.25rem, 7vw, 2rem);
}
}
</style>
<script>
@ -330,9 +326,7 @@ const t = getTranslations(lang);
12 * rootFontSize,
);
const compactSiteNavWidth = Math.max(
expandedWidth -
compactLogoWidth -
7.5 * rootFontSize,
expandedWidth - compactLogoWidth - 7.5 * rootFontSize,
0,
);
const compactNavGap = Math.min(
@ -406,8 +400,7 @@ const t = getTranslations(lang);
) {
if (!slot) return;
const headerIsFullyExpanded =
currentScrollY >= HEADER_SCROLL_DISTANCE;
const headerIsFullyExpanded = currentScrollY >= HEADER_SCROLL_DISTANCE;
slot.classList.toggle(
"is-footer-hidden",

View file

@ -18,6 +18,7 @@ const t = getTranslations(lang);
description={frontmatter.description}
image={frontmatter.image?.url}
>
<main class="post-layout">
<div id="reading-progress" aria-hidden="true"></div>
<a
href="/"
@ -90,6 +91,7 @@ const t = getTranslations(lang);
{t.post.commentsDesc.map((line: string) => <p set:html={line} />)}
<Remark42Embed slug={slug} />
</article>
</main>
</BaseLayout>
<script
@ -169,6 +171,11 @@ const t = getTranslations(lang);
</script>
<style>
.post-layout {
max-width: 850px;
margin: 0 auto;
}
#reading-progress {
position: fixed;
top: 0;

View file

@ -14,10 +14,11 @@ const lang = getLangFromUrl(Astro.url);
const t = getTranslations(lang);
const headerTitle = lang === "zh" ? "Cloverta的博客" : "Cloverta's blog";
const pageTitle = t.home.title;
const rssLink = lang === "zh" ? "/rss.xml" : "/en/rss.xml"
const rssLink = lang === "zh" ? "/rss.xml" : "/en/rss.xml";
---
<BaseLayout pageTitle=`${headerTitle} - ${t.banner.subtitle}`>
<main class="index">
<h1 class="page-title">
<span>{pageTitle}</span>
<a
@ -56,9 +57,15 @@ const rssLink = lang === "zh" ? "/rss.xml" : "/en/rss.xml"
<!-- <Remark42LatestComments lang={lang} client:load /> -->
<LatestComments />
</main>
</BaseLayout>
<style>
.index {
max-width: 850px;
margin: 0 auto;
}
.section-divider {
height: 1px;
background: #cdd2d8;

View file

@ -16,6 +16,7 @@ const pageTitle = lang === "zh" ? "标签索引" : "Tag Index";
---
<BaseLayout pageTitle=`${pageTitle} - ${t.banner.title}`>
<main class="tags-layout">
<h1>{t.tags.title}</h1>
<p>{t.tags.description}</p>
@ -28,9 +29,14 @@ const pageTitle = lang === "zh" ? "标签索引" : "Tag Index";
))
}
</div>
</main>
</BaseLayout>
<style>
.tags-layout {
max-width: 850px;
margin: 0 auto;
}
.tags {
display: flex;
flex-wrap: wrap;