Skip to content

Commit

Permalink
fix: Change OSSes category from output to project (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicstone committed Mar 23, 2024
1 parent 4dd3acd commit dae1cb5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 28 deletions.
2 changes: 1 addition & 1 deletion content
21 changes: 16 additions & 5 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ const config: GatsbyConfig = {
feeds: [
{
serialize: ({
query: { allOutput },
query: { allTimeline },
}: {
query: GatsbyPluginFeedQuery;
}) => {
return allOutput.nodes.map((node) => {
return allTimeline.nodes.map((node) => {
switch (node.__typename) {
case "Mdx":
return {
Expand All @@ -104,11 +104,22 @@ const config: GatsbyConfig = {
description: node.frontmatter.excerpt,
date: node.date,
};
case "ArticlesYaml":
case "SlidesYaml":
case "OssesYaml":
case "NotesYaml":
return {
guid: node.url ?? "",
title: node.title,
url: node.url ?? "",
description: "",
date: node.date,
};
default:
return {
guid: node.url,
guid: node.title,
title: node.title,
url: node.url,
url: SITE_METADATA.siteUrl,
description: "",
date: node.date,
};
Expand All @@ -117,7 +128,7 @@ const config: GatsbyConfig = {
},
query: /* GraphQL */ `
query GatsbyPluginFeed {
allOutput(sort: { date: DESC }) {
allTimeline(sort: { date: DESC }) {
nodes {
__typename
title
Expand Down
8 changes: 0 additions & 8 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,6 @@ export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"]
fields: TimelineFields!
}
type OssesYaml implements Node & Timeline & Output @dontInfer {
title: String!
date: Date! @dateformat
url: String!
tags: [String!]!
fields: TimelineFields!
}
type NotesYaml implements Node & Timeline & Output @dontInfer {
title: String!
date: Date! @dateformat
Expand Down
3 changes: 0 additions & 3 deletions src/features/Timeline/TimelineList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ export const query = graphql`
... on SlidesYaml {
...TimelineSlideCard
}
... on OssesYaml {
...TimelineOssCard
}
... on NotesYaml {
...TimelineNoteCard
}
Expand Down
6 changes: 3 additions & 3 deletions src/features/Timeline/TimelineOssCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TimelineCardBase } from "./TimelineCardBase";

import { GitHubIcon } from "@/components/icons/GitHubIcon";
import { type TimelineOssCardFragment } from "@/generated/graphqlTypes";
import { type M3ColorTokens, outputColorTokens } from "@/layouts/themes";
import { type M3ColorTokens, projectColorTokens } from "@/layouts/themes";
import { formatDateTime } from "@/utils/format";

export const query = graphql`
Expand All @@ -33,9 +33,9 @@ const adoptColorTokens = (colorTokens: M3ColorTokens): CSSObject => {

const StyledTimelineCard = styled(TimelineCardBase)(({ theme }) => {
return {
...adoptColorTokens(outputColorTokens.lightColorTokens),
...adoptColorTokens(projectColorTokens.lightColorTokens),
[theme.getColorSchemeSelector("dark")]: adoptColorTokens(
outputColorTokens.darkColorTokens,
projectColorTokens.darkColorTokens,
),
};
});
Expand Down
19 changes: 11 additions & 8 deletions src/generated/graphqlTypes.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dae1cb5

Please sign in to comment.