Skip to content

Commit

Permalink
Export sharedMetaItems for meta.ts files (#1891)
Browse files Browse the repository at this point in the history
Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
  • Loading branch information
hasparus and dimaMachina authored Dec 18, 2024
1 parent 89941d1 commit 1510524
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-pumas-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@theguild/components": patch
---

Export sharedMetaItems for meta.ts files
1 change: 1 addition & 0 deletions packages/components/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export { fetchFilePathsFromGitHub } from 'nextra/fetch-filepaths-from-github';
export { compileMdx } from 'nextra/compile';
export { getPageMap, createIndexPage } from 'nextra/page-map';
export { fetchPackageInfo } from './npm.js';
export { sharedMetaItems } from './shared-meta-items';

/**
* Contain `getPageMap` import which imports `metadata` from pages, in case importing from
Expand Down
45 changes: 45 additions & 0 deletions packages/components/src/server/shared-meta-items.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { PRODUCTS_MENU_LIST, ProductType } from '../products';

export function sharedMetaItems(options: { githubUrl: string; product: ProductType }) {
return {
products: {
title: 'Products',
type: 'menu',
items: PRODUCTS_MENU_LIST,
},
ecosystem: {
title: 'Ecosystem',
type: 'page',
...(options.product !== 'HIVE' && { href: 'https://the-guild.dev/graphql/hive/ecosystem' }),
},
blog: {
title: 'Blog',
type: 'page',
href: 'https://the-guild.dev/blog',
},
github: {
title: 'GitHub',
type: 'page',
href: options.githubUrl,
},
'the-guild': {
title: 'The Guild',
type: 'menu',
items: {
'about-us': {
title: 'About Us',
href: 'https://the-guild.dev/about-us',
},
'brand-assets': {
title: 'Brand Assets',
href: 'https://the-guild.dev/logos',
},
},
},
'graphql-foundation': {
title: 'GraphQL Foundation',
type: 'page',
href: 'https://graphql.org/community/foundation',
},
};
}

0 comments on commit 1510524

Please sign in to comment.