Skip to content

Commit 1510524

Browse files
hasparusdimaMachina
andauthoredDec 18, 2024··
Export sharedMetaItems for meta.ts files (#1891)
Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
1 parent 89941d1 commit 1510524

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
 

‎.changeset/fair-pumas-trade.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@theguild/components": patch
3+
---
4+
5+
Export sharedMetaItems for meta.ts files

‎packages/components/src/server/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export { fetchFilePathsFromGitHub } from 'nextra/fetch-filepaths-from-github';
77
export { compileMdx } from 'nextra/compile';
88
export { getPageMap, createIndexPage } from 'nextra/page-map';
99
export { fetchPackageInfo } from './npm.js';
10+
export { sharedMetaItems } from './shared-meta-items';
1011

1112
/**
1213
* Contain `getPageMap` import which imports `metadata` from pages, in case importing from
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { PRODUCTS_MENU_LIST, ProductType } from '../products';
2+
3+
export function sharedMetaItems(options: { githubUrl: string; product: ProductType }) {
4+
return {
5+
products: {
6+
title: 'Products',
7+
type: 'menu',
8+
items: PRODUCTS_MENU_LIST,
9+
},
10+
ecosystem: {
11+
title: 'Ecosystem',
12+
type: 'page',
13+
...(options.product !== 'HIVE' && { href: 'https://the-guild.dev/graphql/hive/ecosystem' }),
14+
},
15+
blog: {
16+
title: 'Blog',
17+
type: 'page',
18+
href: 'https://the-guild.dev/blog',
19+
},
20+
github: {
21+
title: 'GitHub',
22+
type: 'page',
23+
href: options.githubUrl,
24+
},
25+
'the-guild': {
26+
title: 'The Guild',
27+
type: 'menu',
28+
items: {
29+
'about-us': {
30+
title: 'About Us',
31+
href: 'https://the-guild.dev/about-us',
32+
},
33+
'brand-assets': {
34+
title: 'Brand Assets',
35+
href: 'https://the-guild.dev/logos',
36+
},
37+
},
38+
},
39+
'graphql-foundation': {
40+
title: 'GraphQL Foundation',
41+
type: 'page',
42+
href: 'https://graphql.org/community/foundation',
43+
},
44+
};
45+
}

0 commit comments

Comments
 (0)
Please sign in to comment.