From 2d36962cda62d55b85260fe40554eeff03093b5e Mon Sep 17 00:00:00 2001 From: Takanori Oishi Date: Sat, 23 Mar 2024 19:25:24 +0900 Subject: [PATCH] fix: Change osses category from output to project --- content | 2 +- gatsby-config.ts | 21 ++++++++++++++++----- src/generated/graphqlTypes.ts | 19 +++++++++++-------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/content b/content index d9a124bc..e6be6e72 160000 --- a/content +++ b/content @@ -1 +1 @@ -Subproject commit d9a124bc05e9bff5f89f47aba26656e504ea8960 +Subproject commit e6be6e72963c3f10617ea4c03d225a5a222397e3 diff --git a/gatsby-config.ts b/gatsby-config.ts index ae4b240f..3f148e7d 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -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 { @@ -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, }; @@ -117,7 +128,7 @@ const config: GatsbyConfig = { }, query: /* GraphQL */ ` query GatsbyPluginFeed { - allOutput(sort: { date: DESC }) { + allTimeline(sort: { date: DESC }) { nodes { __typename title diff --git a/src/generated/graphqlTypes.ts b/src/generated/graphqlTypes.ts index fbffa236..1b04f44e 100644 --- a/src/generated/graphqlTypes.ts +++ b/src/generated/graphqlTypes.ts @@ -2481,7 +2481,7 @@ export type NotesYamlSortInput = { readonly url: InputMaybe; }; -export type OssesYaml = Node & Output & Project & Timeline & { +export type OssesYaml = Node & Project & Timeline & { readonly children: ReadonlyArray; readonly date: Scalars['Date']['output']; readonly fields: TimelineFields; @@ -5208,9 +5208,15 @@ export type WebPOptions = { export type GatsbyPluginFeedQueryVariables = Exact<{ [key: string]: never; }>; -export type GatsbyPluginFeedQuery = { readonly allOutput: { readonly nodes: ReadonlyArray<( +export type GatsbyPluginFeedQuery = { readonly allTimeline: { readonly nodes: ReadonlyArray<( { readonly __typename: 'ArticlesYaml' } & Pick + ) | ( + { readonly __typename: 'CertificationsYaml' } + & Pick + ) | ( + { readonly __typename: 'HistoriesYaml' } + & Pick ) | ( { readonly __typename: 'Mdx' } & Pick @@ -5221,6 +5227,9 @@ export type GatsbyPluginFeedQuery = { readonly allOutput: { readonly nodes: Read ) | ( { readonly __typename: 'OssesYaml' } & Pick + ) | ( + { readonly __typename: 'ProjectsYaml' } + & Pick ) | ( { readonly __typename: 'SlidesYaml' } & Pick @@ -5336,9 +5345,6 @@ export type TimelineListOutputFragment = { readonly group: ReadonlyArray<( ) | ( { readonly __typename: 'NotesYaml' } & Pick - ) | ( - { readonly __typename: 'OssesYaml' } - & Pick ) | ( { readonly __typename: 'SlidesYaml' } & Pick @@ -5480,9 +5486,6 @@ export type OutputsPageQuery = { readonly outputs: { readonly group: ReadonlyArr ) | ( { readonly __typename: 'NotesYaml' } & Pick - ) | ( - { readonly __typename: 'OssesYaml' } - & Pick ) | ( { readonly __typename: 'SlidesYaml' } & Pick