Skip to content

Commit 55c33e8

Browse files
attempts were made
1 parent 184d2d9 commit 55c33e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+7194
-20276
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.gitignore

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
1-
node_modules/
2-
.cache/
3-
public
4-
src/gatsby-types.d.ts
5-
.DS_store
6-
_site/
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
/.cache/
18+
/.contentlayer/
19+
20+
# misc
21+
.DS_Store
22+
*.pem
723
.vscode/
8-
.prettierrc
24+
25+
# debug
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
# local env files
31+
.env*.local
32+
33+
# vercel
34+
.vercel
35+
36+
# typescript
37+
*.tsbuildinfo
38+
next-env.d.ts

README.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1-
# sigpwny.com
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
22

3-
The new SIGPwny website, built with Gatsby.
3+
## Getting Started
44

5-
## Content Types
5+
First, run the development server:
66

7-
This site defines multiple content types that allow for customization, flexibility, and ease of use. For more information, see the [content README](./content/README.md).
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
```
814

9-
## Installing and Building
15+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
1016

11-
Clean install all node packages:
12-
```
13-
npm ci
14-
```
17+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
1518

16-
Install `gatsby-cli`:
17-
```
18-
npm install -g gatsby-cli
19-
```
19+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
2020

21-
Build production and serve:
22-
```
23-
gatsby build
24-
gatsby serve
25-
```
21+
## Learn More
2622

27-
Start a development server:
28-
```
29-
gatsby develop
30-
```
23+
To learn more about Next.js, take a look at the following resources:
3124

32-
## Updating Dependencies
25+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
3327

34-
This site only depends on official Gatsby plugins, so unless a plugin becomes deprecated, the latest versions of Gatsby and its plugins are pretty much guaranteed to work with each other. Ensure that breaking changes are addressed when dealing with major semver updates. Do not commit dependency updates without first verifying that the site built successfully and still operates normally.
28+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
3529

36-
```
37-
npm update
38-
```
30+
## Deploy on Vercel
31+
32+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
33+
34+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

components-old/Card/card.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.card {
2+
background-color: var(--color-surface);
3+
border-color: var(--color-surface);
4+
border-radius: 0.75rem;
5+
isolation: isolate;
6+
overflow: hidden;
7+
position: relative;
8+
box-shadow: none;
9+
bottom: 0;
10+
right: 0;
11+
line-height: 1.2;
12+
transition: 0.1s;
13+
}
14+
.card-hover:hover .card {
15+
box-shadow: 14px 14px var(--color-primary);
16+
bottom: 7px;
17+
right: 7px;
18+
}

components-old/Card/index.tsx

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import React from "react"
2+
import { GatsbyImage, StaticImage, getImage, IGatsbyImageData } from "gatsby-plugin-image"
3+
4+
import "./card.css"
5+
import SmartLink from "../SmartLink"
6+
7+
const Card = ({ heading, title, image, overlay_image, link }: CardProps) => {
8+
var card_component = (
9+
<div className="card h-100 grow use-color-text">
10+
<div className="aspect-video grid">
11+
{(image || overlay_image) ? (
12+
<>
13+
{image && image.path && getImage(image.path) && (
14+
<GatsbyImage
15+
image={getImage(image.path) as IGatsbyImageData}
16+
alt={image.alt}
17+
className="row-span-full col-span-full"
18+
/>
19+
)}
20+
{overlay_image && overlay_image.path && getImage(overlay_image.path) && (
21+
<div className="row-span-full col-span-full overflow-hidden p-4 grid items-center">
22+
{/* I spent a while to figure out that the combination of:
23+
- parent div: overflow-hidden
24+
- child div: max-h-full
25+
- child img: scale-down
26+
will resize the image in a nice way... I have no idea
27+
how it works.*/}
28+
<GatsbyImage
29+
image={getImage(overlay_image.path) as IGatsbyImageData}
30+
alt={overlay_image.alt}
31+
className="max-h-full"
32+
objectFit="scale-down"
33+
/>
34+
</div>
35+
)}
36+
</>
37+
) : (
38+
<StaticImage
39+
src="./placeholder.png"
40+
alt="Placeholder image"
41+
/>
42+
)}
43+
</div>
44+
{(title || heading) && (
45+
<div className="p-2">
46+
{heading && (
47+
<p className="line-clamp-1 leading-4 m-0 font-mono font-size-small">
48+
{heading}
49+
</p>
50+
)}
51+
{title && (
52+
<p className="line-clamp-2 leading-5 mb-1">
53+
{title}
54+
</p>
55+
)}
56+
</div>
57+
)}
58+
</div>
59+
)
60+
if (link) {
61+
return (
62+
<SmartLink to={link} className="card-hover flex grow">
63+
{card_component}
64+
</SmartLink>
65+
)
66+
}
67+
return (
68+
<div className="flex-grow">
69+
{card_component}
70+
</div>
71+
)
72+
}
73+
74+
export default Card

components-old/Card/placeholder.png

103 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

content/meetings/sp2024/2024-01-01/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ if (highlighted == true) {
4242
}
4343
```
4444

45+
![Markdown image syntax doesn't work :(, at least not without hacks](./image.png)
46+
4547
Here is an unordered list:
4648
- Item A
4749
- Subitem 1

contentlayer.config.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import {
2+
defineDocumentType,
3+
defineNestedType,
4+
makeSource
5+
} from "@contentlayer/source-files"
6+
import path from "path"
7+
import remarkGfm from "remark-gfm"
8+
import remarkMdxImages from "remark-mdx-images"
9+
10+
import { calculateSemester } from "./src/utils/util"
11+
import transformImgSrc from './src/plugins/transform-img-src.mjs'
12+
13+
export const Image = defineNestedType(() => ({
14+
name: "Image",
15+
fields: {
16+
path: { type: "string", required: false },
17+
alt: { type: "string", required: false },
18+
},
19+
}))
20+
21+
export const Meeting = defineDocumentType(() => ({
22+
name: "Meeting",
23+
contentType: "mdx",
24+
filePathPattern: `**/*.{md,mdx}`,
25+
fields: {
26+
title: { type: "string", required: true },
27+
time_start: { type: "string", required: true },
28+
time_close: { type: "string", required: false },
29+
week_number: { type: "number", required: false, default: 0 },
30+
credit: { type: "list", of: { type: "string" }, default: ["SIGPwny"] },
31+
featured: { type: "boolean", required: false, default: false },
32+
location: { type: "string", required: false },
33+
slides: { type: "string", required: false },
34+
assets: { type: "list", of: { type: "string" } },
35+
image: { type: "nested", of: Image}, // TODO: add default placeholder image
36+
recording: { type: "string", required: false },
37+
tags: { type: "list", of: { type: "string" }, default: ["untagged"] },
38+
},
39+
computedFields: {
40+
semester: { type: "string", resolve: (meeting) => calculateSemester(meeting.time_start) },
41+
slug: { type: "string", resolve: (meeting) => `/meetings/${meeting._raw.flattenedPath}` },
42+
slidesDistUrl: {
43+
type: "string",
44+
resolve: (meeting) => {
45+
if (!meeting.slides) return null
46+
// get the content path of the slides (format: content/meetings/2021-09-01/slide_name.pdf)
47+
const slidesPath = path.join(meeting._raw.flattenedPath, meeting.slides)
48+
console.log(slidesPath)
49+
}
50+
},
51+
},
52+
}))
53+
54+
export default makeSource({
55+
contentDirPath: "./content/meetings/", documentTypes: [Meeting],
56+
mdx: { remarkPlugins: [remarkGfm, transformImgSrc] }
57+
// mdx: {
58+
// remarkPlugins: [remarkGfm, remarkMdxImages],
59+
// esbuildOptions: (options) => {
60+
// options.loader = {
61+
// ...options.loader,
62+
// '.png': 'dataurl',
63+
// '.jpg': 'dataurl',
64+
// '.jpeg': 'dataurl',
65+
// '.gif': 'dataurl',
66+
// }
67+
// return options
68+
// },
69+
// }
70+
})

gatsby-browser.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)