-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup gatsby * Move public * Move components * Move lib * Move scss * Add module types for direct import * Remove unused * Migrate 404 * Migrate link * Migrate index * Migrate policy * Migrate member * Migrate blog index * Remove console * Fix to use slug in link * Ignore page-data * Add nodes generator * Migrate blog pages * Bump setup-bun * Remove things related to next.js * Remove unused import
- Loading branch information
1 parent
4bea5cd
commit fc38572
Showing
75 changed files
with
2,824 additions
and
566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import type { GatsbyConfig } from "gatsby"; | ||
|
||
const config: GatsbyConfig = { | ||
siteMetadata: { | ||
title: `site`, | ||
siteUrl: `https://approvers.dev`, | ||
}, | ||
// More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense. | ||
// If you use VSCode you can also use the GraphQL plugin | ||
// Learn more at: https://gatsby.dev/graphql-typegen | ||
graphqlTypegen: true, | ||
plugins: [ | ||
"@chakra-ui/gatsby-plugin", | ||
"gatsby-plugin-sass", | ||
"gatsby-plugin-sitemap", | ||
{ | ||
resolve: "gatsby-plugin-manifest", | ||
options: { | ||
icon: "public/android-chrome-512x512.png", | ||
}, | ||
}, | ||
"gatsby-transformer-remark", | ||
{ | ||
resolve: "gatsby-source-filesystem", | ||
options: { | ||
name: "data", | ||
path: "./data", | ||
}, | ||
__key: "data", | ||
}, | ||
{ | ||
resolve: "gatsby-omni-font-loader", | ||
options: { | ||
enableListener: true, | ||
preconnect: [`https://fonts.googleapis.com`, `https://fonts.gstatic.com`], | ||
web: [ | ||
{ | ||
name: `Roboto`, | ||
file: `https://fonts.googleapis.com/css2?family=Roboto:ital@0;1&display=swap`, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { type GatsbyNode, type NodeInput } from "gatsby"; | ||
import { getMembers } from "./src/lib/member-fetch"; | ||
import path from "path"; | ||
|
||
export const sourceNodes: GatsbyNode["sourceNodes"] = async (api) => { | ||
const members = await getMembers(); | ||
for (const member of members) { | ||
const id = api.createNodeId(member.discordId); | ||
const node = { | ||
...member, | ||
id, | ||
_id: member.discordId, | ||
parent: null, | ||
children: [], | ||
internal: { | ||
type: "Member", | ||
contentDigest: api.createContentDigest(member), | ||
}, | ||
} satisfies NodeInput; | ||
api.actions.createNode(node); | ||
} | ||
}; | ||
|
||
export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"] = (api) => { | ||
api.actions.createTypes(` | ||
enum SNSKind { | ||
github | ||
} | ||
type SNSLinkInfo { | ||
type: SNSKind! | ||
name: String! | ||
} | ||
type Member implements Node { | ||
username: String! | ||
discordId: ID! | ||
associatedLinks: [SNSLinkInfo!]! | ||
} | ||
`); | ||
}; | ||
|
||
export const createPages: GatsbyNode["createPages"] = async (api) => { | ||
const res = await api.graphql<{ | ||
allMarkdownRemark: { | ||
nodes: { | ||
rawMarkdownBody: string; | ||
frontmatter: { | ||
title: string; | ||
author: string; | ||
authorId: string; | ||
date: string; | ||
}; | ||
parent: { | ||
name: string; | ||
}; | ||
}[]; | ||
}; | ||
}>(` | ||
{ | ||
allMarkdownRemark(sort: { frontmatter: { date: ASC } }) { | ||
nodes { | ||
rawMarkdownBody | ||
frontmatter { | ||
title | ||
author | ||
authorId | ||
date | ||
} | ||
parent { | ||
... on File { | ||
name | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`); | ||
if (res.errors) { | ||
api.reporter.error("querying markdown pages failed"); | ||
return; | ||
} | ||
|
||
const pages = res.data?.allMarkdownRemark.nodes!; | ||
const component = path.resolve("src/templates/blog-post.tsx"); | ||
for (let i = 0; i < pages.length; ++i) { | ||
const slug = path.basename(pages[i].parent.name); | ||
const prevSlug = i > 0 ? path.basename(pages[i - 1].parent.name) : null; | ||
const nextSlug = i < pages.length - 1 ? path.basename(pages[i + 1].parent.name) : null; | ||
api.actions.createPage({ | ||
path: `/blog/${slug}`, | ||
component, | ||
context: { | ||
slug, | ||
content: pages[i].rawMarkdownBody, | ||
frontmatter: pages[i].frontmatter, | ||
prevSlug, | ||
nextSlug, | ||
}, | ||
}); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"icons":[{"src":"icons/icon-48x48.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"48x48","type":"image/png"},{"src":"icons/icon-72x72.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"72x72","type":"image/png"},{"src":"icons/icon-96x96.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"96x96","type":"image/png"},{"src":"icons/icon-144x144.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"144x144","type":"image/png"},{"src":"icons/icon-192x192.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"192x192","type":"image/png"},{"src":"icons/icon-256x256.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"256x256","type":"image/png"},{"src":"icons/icon-384x384.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"384x384","type":"image/png"},{"src":"icons/icon-512x512.png?v=3d36871a2852fe966ee689252b18b2f7","sizes":"512x512","type":"image/png"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
declare module "*.module.scss" { | ||
const content: { [className: string]: string }; | ||
export = content; | ||
} | ||
|
||
declare module "*.yaml" { | ||
const content: { [className: string]: string }; | ||
export = content; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.