From 65de6839fc3481caf51025cb6e2ac7dd7cc8a4ea Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Thu, 21 Sep 2023 21:13:54 +0200 Subject: [PATCH] docs(blog): updated --- frontend/Dockerfile.dev | 2 +- frontend/app/layout.tsx | 2 +- frontend/{app => }/globals.css | 44 ------------------ frontend/pages/blog/index.tsx | 81 ++++++++++++++++++++++++---------- 4 files changed, 59 insertions(+), 70 deletions(-) rename frontend/{app => }/globals.css (50%) diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev index b1868a76d..e096f5ae3 100644 --- a/frontend/Dockerfile.dev +++ b/frontend/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM node:18-alpine +FROM node:18.13.0-alpine # Install Python and essential build tools RUN apk add --update --no-cache python3 make g++ && ln -sf python3 /usr/bin/python RUN python3 -m ensurepip diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index f71ffc176..6fabd068d 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -8,8 +8,8 @@ import { FeatureFlagsProvider } from "@/lib/context"; import { BrainProvider } from "@/lib/context/BrainProvider"; import { SupabaseProvider } from "@/lib/context/SupabaseProvider"; +import "@/globals.css"; import { App } from "./App"; -import "./globals.css"; const inter = Inter({ subsets: ["latin"] }); diff --git a/frontend/app/globals.css b/frontend/globals.css similarity index 50% rename from frontend/app/globals.css rename to frontend/globals.css index a2c4eb2ef..96d8c4144 100644 --- a/frontend/app/globals.css +++ b/frontend/globals.css @@ -37,48 +37,4 @@ a { /* background: #000; */ @apply bg-gray-500; } -} - -.custom-prose { - max-height: 60vh; - /* Adjust this value based on the desired maximum height */ - overflow-y: auto; - /* Enable vertical scroll if the content exceeds the maximum height */ - padding-right: 1rem; - /* Optional: Add some padding if the scrollbar appears, so the text is not squished */ -} - - -.container, -.post { - width: 100%; - min-height: 100vh; - margin: 0 auto; - padding: 40px 0; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -.container h1, -.post h1 { - font-size: 2em; -} - -.card { - display: flex; - flex-direction: row; - justify-content: center; - flex-wrap: wrap; - padding: 40px 0; -} - -.flexing { - width: 30%; - box-sizing: content-box; - background: #f8f6f8; - margin: 1%; - padding: 30px; - border-radius: 8px; } \ No newline at end of file diff --git a/frontend/pages/blog/index.tsx b/frontend/pages/blog/index.tsx index 6490b4dcc..af6322b41 100644 --- a/frontend/pages/blog/index.tsx +++ b/frontend/pages/blog/index.tsx @@ -5,6 +5,7 @@ import Head from "next/head"; import Image from "next/image"; import Link from "next/link"; +import "@/globals.css"; type BlogPostAttributes = { imageUrl: string; @@ -41,36 +42,68 @@ export const getStaticProps = async () => { // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types const Blog = ({ result }: InferGetStaticPropsType) => { return ( -
+
- thisBlog - + Quivr - Blog + -
-

Blog Posts

-
- {result.map(post => ( - -
-
- blog-post -
-

{post.attributes.title}

-

{post.attributes.description}

-
- - ))} +
+

Blog Posts

+
+ {result.map((post, index) => { + if (index === 0) { + // Special layout for the first post + return ( + +
+

{post.attributes.title}

+

{post.attributes.description}

+
+
+ blog-post +
+ + ); + } else { + // Standard layout for the rest of the posts + return ( + +
+ blog-post +
+

{post.attributes.title}

+

{post.attributes.description}

+ + ); + } + })}
); } + + + export default Blog;