diff --git a/docs/components/Avatar.tsx b/docs/components/Avatar.js similarity index 74% rename from docs/components/Avatar.tsx rename to docs/components/Avatar.js index e4e79d636822b..4ee689708bc86 100644 --- a/docs/components/Avatar.tsx +++ b/docs/components/Avatar.js @@ -1,12 +1,6 @@ import Image from "next/image"; -type Props = { - name: string; - picture: string; - twitterUsername: string; -}; - -export const Avatar = ({ name, picture, twitterUsername }: Props) => { +export const Avatar = ({ name, picture, twitterUsername }) => { return (
{ width={32} layout="fixed" priority={true} - className="rounded-full" + className="w-full rounded-full" alt={name} />
Name
-
{name}
+
{name}
Twitter
@{/* */} {twitterUsername} diff --git a/docs/nextra-theme-docs/index.js b/docs/nextra-theme-docs/index.js index a5f97c777458a..7955182ba1892 100644 --- a/docs/nextra-theme-docs/index.js +++ b/docs/nextra-theme-docs/index.js @@ -1,4 +1,5 @@ import React, { useMemo, useState } from "react"; +import format from "date-fns/format"; import { useRouter } from "next/router"; import "focus-visible"; import { SkipNavContent } from "@reach/skip-nav"; @@ -21,6 +22,8 @@ import sortDate from "./utils/sort-date"; import Link from "next/link"; import { Footer as FooterMain } from "../components/Footer"; import { Avatar } from "../components/Avatar"; +import { formatDistanceToNow } from "date-fns"; +import renderComponent from "./utils/render-component"; function useDirectoryInfo(pageMap) { const { locale, defaultLocale, asPath } = useRouter(); @@ -55,10 +58,20 @@ function Body({ meta, toc, filepathWithName, navLinks, children, postList }) { ) ) : postList ? (
-
-

Blog

- {postList} -
+
+
+

+ Blog +

+
+ The latest updates and releases from the Turborepo team at + Vercel. +
+
+
+ {postList} +
+
) : meta.full ? ( @@ -68,16 +81,22 @@ function Body({ meta, toc, filepathWithName, navLinks, children, postList }) { ) : meta.type === "post" ? (
-
-

+
+

{meta.title}

+
+ {format(new Date(meta.date), "MMMM do, yyyy")} ( + {formatDistanceToNow(new Date(meta.date), { + includeSeconds: false, + addSuffix: true, + })} + ) +
- + {config.authors + ? renderComponent(config.authors, { authors: meta.authors }) + : null}
@@ -188,20 +207,11 @@ const Layout = ({ const postList = posts ? (