fix: add flag to reduce dom weight

This commit is contained in:
Felix Roos
2023-08-11 01:20:31 +02:00
parent 5101bb298e
commit d649d3e940
2 changed files with 10 additions and 5 deletions
@@ -8,9 +8,10 @@ type Props = {
frontmatter: Frontmatter;
headings: MarkdownHeading[];
githubEditUrl: string;
hideMoreMenu?: boolean;
};
const { frontmatter, headings, githubEditUrl } = Astro.props as Props;
const { frontmatter, headings, githubEditUrl, hideMoreMenu } = Astro.props as Props;
const title = frontmatter.title;
const currentPage = Astro.url.pathname;
---
@@ -22,9 +23,13 @@ const currentPage = Astro.url.pathname;
<slot />
</div>
</section>
<nav class="block sm:hidden">
<MoreMenu editHref={githubEditUrl} />
</nav>
{
!hideMoreMenu && (
<nav class="block sm:hidden">
<MoreMenu editHref={githubEditUrl} />
</nav>
)
}
</article>
<style>
.content {
+1 -1
View File
@@ -40,7 +40,7 @@ const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
<aside title="Site Navigation" class="w-[300px] px-6 left-0 hidden md:block fixed h-full">
<ReferenceSidebar currentPage={currentPage} />
</aside>
<PageContent frontmatter={frontmatter} headings={headings} githubEditUrl={githubEditUrl}>
<PageContent hideMoreMenu={true} frontmatter={frontmatter} headings={headings} githubEditUrl={githubEditUrl}>
<slot />
</PageContent>
</div>