Changed blog nav menu; <main> width:100% only in articles

This commit is contained in:
DarkCat09 2023-07-26 14:47:12 +04:00
parent ffd45a4cc6
commit d148f1e0f3
4 changed files with 10 additions and 8 deletions

View file

@ -6,19 +6,18 @@ import MenuItem from "../components/MenuItem.astro";
export interface Props { export interface Props {
title: string; title: string;
description: string; description: string;
article?: boolean; mainpage?: boolean;
} }
const { title, description, article = false } = Astro.props; const { title, description, mainpage = false } = Astro.props;
--- ---
<Layout title={"Blog | " + title} description={description}> <Layout title={"Blog | " + title} description={description}>
<slot name="metadata" slot="metadata" /> <slot name="metadata" slot="metadata" />
<NavMenu> <NavMenu>
{ {
!article ? mainpage ?
<MenuItem name="Home" icon="&#xf104;" link="/" /> <MenuItem name="Home" icon="&#xf104;" link="/" /> :
<MenuItem name="Articles" icon="&#xf1ea;" link="/blog" /> :
<MenuItem name="Articles" icon="&#xf104;" link="/blog" /> <MenuItem name="Articles" icon="&#xf104;" link="/blog" />
} }
<MenuItem name="Shorts" icon="&#xf0e7;" link="/blog/shorts" /> <MenuItem name="Shorts" icon="&#xf0e7;" link="/blog/shorts" />

View file

@ -52,7 +52,6 @@ const { title, description } = Astro.props;
margin: auto; margin: auto;
padding: @main-padding; padding: @main-padding;
max-width: @max-width; max-width: @max-width;
width: 100%;
} }
article { article {

View file

@ -22,7 +22,7 @@ const {
} = await postRenderer(post); } = await postRenderer(post);
--- ---
<BlogLayout title={title} description={description} article={true}> <BlogLayout title={title} description={description}>
<Fragment slot="metadata"> <Fragment slot="metadata">
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:title" content={title} /> <meta property="og:title" content={title} />
@ -48,6 +48,10 @@ const {
<style lang="less" is:global> <style lang="less" is:global>
@import "/src/styles/max_width.less"; @import "/src/styles/max_width.less";
main {
width: 100%;
}
article { article {
margin: 0; margin: 0;

View file

@ -28,7 +28,7 @@ const description =
"The simpliest things!"; "The simpliest things!";
--- ---
<BlogLayout title="Homepage" description={description}> <BlogLayout title="Homepage" description={description} mainpage>
<Fragment slot="metadata"> <Fragment slot="metadata">
<meta name="robots" content="noindex, follow" /> <meta name="robots" content="noindex, follow" />
</Fragment> </Fragment>