Skip to content

Commit

Permalink
works v1
Browse files Browse the repository at this point in the history
  • Loading branch information
olayway committed Aug 7, 2023
1 parent c439bd6 commit 9c411f1
Show file tree
Hide file tree
Showing 14 changed files with 9,126 additions and 12,625 deletions.
4 changes: 2 additions & 2 deletions components/custom/InitiativeCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function InitiativeCard({ initiative }) {
<li className="group relative flex flex-col items-start m-0 p-0">
<div role="heading" className="text-base font-semibold text-primary">
<div className="absolute -inset-x-4 -inset-y-6 z-0 scale-95 bg-zinc-100 opacity-0 transition group-hover:scale-100 group-hover:opacity-100 sm:-inset-x-6 sm:rounded-2xl"></div>
<Link href={initiative.url_path} className="flex flex-col transition font-medium text-primary group-hover:text-secondary">
<Link href={initiative.urlPath} className="flex flex-col transition font-medium text-primary group-hover:text-secondary">
<span className="absolute -inset-x-4 -inset-y-6 z-20 sm:-inset-x-6 sm:rounded-2xl" />
{initiative.image && <img src={initiative.image} className="z-10 w-full aspect-video object-cover object-left m-0 rounded-lg shadow-sm" />}
<span className="relative z-10 mt-4">
Expand All @@ -21,4 +21,4 @@ export default function InitiativeCard({ initiative }) {
</p>
</li>
)
}
}
13 changes: 13 additions & 0 deletions layouts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
SimpleLayout,
DocsLayout,
UnstyledLayout,
BlogLayout,
} from "@portaljs/core";

export default {
simple: SimpleLayout,
docs: DocsLayout,
unstyled: UnstyledLayout,
blog: BlogLayout,
};
19,422 changes: 7,848 additions & 11,574 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 4 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,28 @@
"generate": "cross-env NODE_OPTIONS=\"--experimental-json-modules --experimental-modules\" node -r esbuild-register ./scripts/prebuild.mjs"
},
"dependencies": {
"@docsearch/react": "^3.2.0",
"@headlessui/react": "^1.6.6",
"@splidejs/react-splide": "^0.7.12",
"clsx": "^1.2.1",
"crypto-js": "^4.1.1",
"d3": "^7.6.1",
"d3-ternary": "^2.0.14",
"date-fns": "^2.29.2",
"fuse.js": "^6.6.2",
"@heroicons/react": "^1.0.6",
"@portaljs/core": "^1.0.5",
"@portaljs/remark-callouts": "^1.0.5",
"@portaljs/remark-embed": "^1.0.4",
"@portaljs/remark-wiki-link": "^1.0.4",
"@silvenon/remark-smartypants": "^2.0.0",
"@splidejs/react-splide": "^0.7.12",
"@tailwindcss/typography": "^0.5.9",
"@types/node": "18.14.2",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"date-fns": "^2.29.3",
"gray-matter": "^4.0.3",
"itemsjs": "^2.1.15",
"kbar": "^0.1.0-beta.37",
"next-themes": "^0.2.1",
"hastscript": "^7.2.0",
"kbar": "^0.1.0-beta.37",
"mddb": "^0.1.9",
"mdx-mermaid": "2.0.0-rc7",
"next": "13.3.0",
"next-mdx-remote": "^4.4.1",
"next-seo": "^5.15.0",
"react": "^18.2.0",
"react-aria": "^3.20.0",
"react-dom": "^18.2.0",
"react-stately": "^3.18.0",
"rehype-autolink-headings": "^6.1.1",
"rehype-katex": "^6.0.2",
"rehype-prism-plus": "^1.5.1",
Expand All @@ -52,7 +42,6 @@
"remark-math": "^5.1.1",
"remark-smartypants": "^2.0.0",
"remark-toc": "^8.0.1",
"sort-array": "^4.1.5",
"strip-markdown": "^5.0.0",
"typed.js": "^2.0.12",
"typescript": "^4.9.5"
Expand Down
59 changes: 59 additions & 0 deletions pages/blog/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import fs from "fs";
import React from "react";
import { GetStaticProps, GetStaticPropsResult } from "next";

import { BlogsList, SimpleLayout } from "@portaljs/core";
import clientPromise from "../../lib/mddb.mjs";
import computeFields from "../../lib/computeFields";
import type { CustomAppProps } from "../_app";

interface BlogIndexPageProps extends CustomAppProps {
blogs: any[]; // TODO types
}

export default function Blog({
blogs,
meta: { title, description },
}: BlogIndexPageProps) {
return (
<SimpleLayout title={title} description={description}>
<BlogsList blogs={blogs} />
</SimpleLayout>
);
}

export const getStaticProps: GetStaticProps = async (): Promise<
GetStaticPropsResult<BlogIndexPageProps>
> => {
const mddb = await clientPromise;
const blogFiles = await mddb.getFiles({ folder: "blog" });
const blogsMetadataPromises = blogFiles.map(async (b) => {
const source = fs.readFileSync(b.file_path, { encoding: "utf-8" });

// TODO temporary replacement for contentlayer's computedFields
const frontMatterWithComputedFields = await computeFields({
frontMatter: b.metadata,
urlPath: b.url_path,
filePath: b.file_path,
source,
});

return frontMatterWithComputedFields;
});

const blogsList = await Promise.all(blogsMetadataPromises);

return {
props: {
meta: {
title: "Blog posts",
showSidebar: false,
showToc: false,
showComments: false,
showEditLink: false,
urlPath: "/blog",
},
blogs: blogsList,
},
};
};
158 changes: 0 additions & 158 deletions pages/ecosystem.jsx

This file was deleted.

Loading

0 comments on commit 9c411f1

Please sign in to comment.