refactor: rearrange the dom structure

This commit is contained in:
草师傅 2025-07-23 19:13:03 +08:00
parent 0f0f925dd7
commit be07b543aa
Signed by: gb
GPG key ID: 43330A030E2D6478
3 changed files with 26 additions and 31 deletions

View file

@ -50,33 +50,29 @@ const { title = pageTitle, author = siteConfig.defaultAuthor.name,description =
{spaEnabled && <ClientRouter fallback="animate" />} {spaEnabled && <ClientRouter fallback="animate" />}
<!--transitional animation is broken in firefox though--> <!--transitional animation is broken in firefox though-->
</head> </head>
<body> <body class="container">
<main> {noscript && <div id="top" style="visibility: hidden">Back To Top</div>}
{noscript && <div id="top" style="visibility: hidden">Back To Top</div>} <header>
<div class="container"> <div class="terminal-path">
<div class="terminal-path"> {path}
{path} </div>
</div> <Navbar />
<Navbar /> <Search />
<Search /> </header>
<main class="content-box">
<div class="content-box"> <slot />
<slot /> </main>
</div>
</div>
</main>
<footer class="footer">
<div class="floating">
<BackToTop/>
{noscript ? <ThemeSwitcher_CSSOnly/> : <ThemeSwitcher/>} <footer class="footer">
</div> <div class="floating">
<div class="container"> <BackToTop/>
<Fragment set:html={customFooter} /> {noscript ? <ThemeSwitcher_CSSOnly/> : <ThemeSwitcher/>}
<p>Powered by <a href="https://git.gb0.dev/gb/mercury" target="_blank"><Logo width={16} height={16} /> mercury</a></p> </div>
</div> <div class="container">
</footer> <Fragment set:html={customFooter} />
<p>Powered by <a href="https://git.gb0.dev/gb/mercury" target="_blank"><Logo width={16} height={16} /> mercury</a></p>
</div>
</footer>
{statisticsEnabled && <Statistics/>} {statisticsEnabled && <Statistics/>}
{ (siteConfig.neko.enabled && !noscript) && { (siteConfig.neko.enabled && !noscript) &&
<> <>

View file

@ -58,8 +58,8 @@ const cover = customFeaturedImage || matchedImage_src?.src || firstImageURL || `
<div class="content"> <div class="content">
<Content /> <Content />
</div> </div>
</article>
<div class="extra-post" style="margin-top: 2rem; border-top: 1px solid var(--border-color); padding-top: 1rem;"> <div class="extra-post" style="margin-top: 2rem; border-top: 1px solid var(--border-color); padding-top: 1rem;">
<ReplyViaEmail title={entry.data.title} email={authorInfo[0].email} /> <ReplyViaEmail title={entry.data.title} email={authorInfo[0].email} />
<br> <br>
<a href="/blog">&larr; Back to posts</a> <a href="/blog">&larr; Back to posts</a>
@ -69,8 +69,7 @@ const cover = customFeaturedImage || matchedImage_src?.src || firstImageURL || `
import "katex/dist/contrib/copy-tex.js" import "katex/dist/contrib/copy-tex.js"
</script> </script>
} }
</article> </div>
</div>
</Layout> </Layout>
<style> <style>
p.summary { p.summary {

View file

@ -70,7 +70,7 @@ a:hover {
opacity: 0.8; opacity: 0.8;
} }
main { body {
max-width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
padding: 2rem 1rem; padding: 2rem 1rem;