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 {
title: 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}>
<slot name="metadata" slot="metadata" />
<NavMenu>
{
!article ?
<MenuItem name="Home" icon="&#xf104;" link="/" />
<MenuItem name="Articles" icon="&#xf1ea;" link="/blog" /> :
mainpage ?
<MenuItem name="Home" icon="&#xf104;" link="/" /> :
<MenuItem name="Articles" icon="&#xf104;" link="/blog" />
}
<MenuItem name="Shorts" icon="&#xf0e7;" link="/blog/shorts" />

View file

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

View file

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

View file

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