From ec390d06ddfdc09f5a543ef5b6ef89ddd391a4ac Mon Sep 17 00:00:00 2001 From: eveeifyeve Date: Sat, 13 Apr 2024 00:25:54 +1000 Subject: [PATCH] feat: improved news with a layout and a darker readable color --- src/layouts/newspost.astro | 103 ++++++++++++++++++ .../updates/new-staffaplications-19-3-24.mdx | 55 ++++------ src/styles/style.css | 5 + 3 files changed, 130 insertions(+), 33 deletions(-) create mode 100644 src/layouts/newspost.astro diff --git a/src/layouts/newspost.astro b/src/layouts/newspost.astro new file mode 100644 index 0000000..2debeea --- /dev/null +++ b/src/layouts/newspost.astro @@ -0,0 +1,103 @@ +--- +import { twMerge } from "tailwind-merge"; +import Footer from "@component/footer.astro"; +import Head from "@component/head.astro"; +import Header from "@component/header.astro"; +import DiscordSVG from "@assets/svgs/Discord.svg"; +import GithubSVG from "@assets/svgs/Github-white.svg"; +import { Image } from 'astro:assets'; + + +// Styles +import "../styles/style.css"; + +export interface Props { + postprops: PostProps; + className?: string; +} + +export interface PostProps { + author: AuthorProps; + title: string; + desc?: string; + banner: string; + bannerSize: number; + pubDate: string; +} + +export interface AuthorProps { + name: string; + role: string; + img?: string; + socials?: AuthorSocialsProps; +} + +export interface AuthorSocialsProps { + discordServer?: string; + github?: string; +} +const Sociallogosizes = 36; + +const { postprops, className } = Astro.props; +const pubDate = new Date(postprops.pubDate); +const formattedPubDate = `${pubDate.toLocaleDateString()}`; +--- + + +
+
+
+ <- Back to News Articles + Published on: {formattedPubDate} +
+ +
+
+ {`${postprops.title} +
+ +

{postprops.title}

+ +
+ +
+
+
+ {`${postprops.author.name}`} + {postprops.author.name} +
+
{postprops.author.role}
+
+ {postprops.author.socials && ( +
+ {postprops.author.socials.github && ( + Github Logo + )} + {postprops.author.socials.discordServer && ( + Github Logo + )} +
+ )} +
+
+