refactor: 优化前端布局结构并移除管理页面链接

This commit is contained in:
seahi committed 2026-07-29 18:18:25 +08:00
1 parent 36b943896b
commit 922811afd8
2 files changed
+12 -1

No files matched your search

+10
View File
@@ -37,6 +37,16 @@ body {
line-height: 1.8; line-height: 1.8;
} }
.frontend-layout {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.frontend-layout > main {
flex: 1 0 auto;
}
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
font-family: var(--font-sans); font-family: var(--font-sans);
color: var(--title-color); color: var(--title-color);
+2 -1
View File
@@ -34,6 +34,7 @@
{#if $page.url.pathname.startsWith('/admin')} {#if $page.url.pathname.startsWith('/admin')}
{@render children()} {@render children()}
{:else} {:else}
<div class="frontend-layout">
<header class="header {scrolled ? 'scrolled' : ''}"> <header class="header {scrolled ? 'scrolled' : ''}">
<div class="container wide"> <div class="container wide">
<a href="/" class="brand">{$page.data.site?.title || 'BlogFlare'}</a> <a href="/" class="brand">{$page.data.site?.title || 'BlogFlare'}</a>
@@ -41,7 +42,6 @@
<a href="/" class={$page.url.pathname === '/' ? 'active' : ''}>首页</a> <a href="/" class={$page.url.pathname === '/' ? 'active' : ''}>首页</a>
<a href="/archive" class={$page.url.pathname.startsWith('/posts') || $page.url.pathname.startsWith('/archive') ? 'active' : ''}>{$page.data.aliases?.post || '文章'}</a> <a href="/archive" class={$page.url.pathname.startsWith('/posts') || $page.url.pathname.startsWith('/archive') ? 'active' : ''}>{$page.data.aliases?.post || '文章'}</a>
<a href="/about" class={$page.url.pathname.startsWith('/about') ? 'active' : ''}>关于</a> <a href="/about" class={$page.url.pathname.startsWith('/about') ? 'active' : ''}>关于</a>
<a href="/admin" class={$page.url.pathname.startsWith('/admin') ? 'active' : ''}>后台</a>
</nav> </nav>
</div> </div>
</header> </header>
@@ -83,4 +83,5 @@
</a> </a>
</div> </div>
</aside> </aside>
</div>
{/if} {/if}