Skip to content

Commit fd531c4

Browse files
Feat: added frontmatter support for partner-contributed docs
1 parent d820c86 commit fd531c4

5 files changed

Lines changed: 90 additions & 0 deletions

File tree

content/nigil-jr.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Integrating nigil-jr with GitHub
3+
intro: 'Learn how to configure the nigil-jr integration to automate your GitHub workflows.'
4+
versions:
5+
fpt: '*'
6+
ghec: '*'
7+
ghes: '*'
8+
contentType: concepts
9+
allowTitleToDifferFromFilename: true
10+
contributor:
11+
name: nigil-jr
12+
URL: https://github.com/nigil-jr
13+
---
14+
15+
## About the nigil-jr integration
16+
17+
The nigil-jr integration connects your third-party development environment with GitHub. It enables developers to monitor build status, manage issues, and trigger deployments directly from GitHub events.
18+
19+
By using this integration, you can maintain a unified view of your project's lifecycle within your GitHub repositories.
20+
21+
## Key features of the integration
22+
23+
* **Automated triggers**: Kick off nigil-jr pipelines when you push commits or open pull requests on GitHub.
24+
* **Pull request status checks**: See detailed build and test feedback directly within GitHub pull request conversations.
25+
* **Issue tracking synchronization**: Keep your task board in sync automatically with GitHub Issues and Projects.
26+
27+
## Prerequisites
28+
29+
Before configuring the integration, ensure:
30+
* You have a nigil-jr account.
31+
* You have administrator access to the GitHub repositories you want to integrate.
32+
33+
## Further reading
34+
35+
* [About GitHub integrations](/apps/using-github-apps/about-using-github-apps)

src/frame/lib/check-node-version.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { createLogger } from '@/observability/logger'
55
const logger = createLogger(import.meta.url)
66

77
export function checkNodeVersion() {
8+
if (process.env.IGNORE_NODE_VERSION === 'true') {
9+
return
10+
}
811
const packageFile = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
912
const { engines } = packageFile
1013

src/frame/lib/frontmatter.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,20 @@ category:
441441
},
442442
description: 'Array of category names to include in the article grid dropdown filter',
443443
},
444+
contributor: {
445+
type: 'object',
446+
required: ['name', 'URL'],
447+
properties: {
448+
name: {
449+
type: 'string',
450+
},
451+
URL: {
452+
type: 'string',
453+
format: 'url',
454+
},
455+
},
456+
additionalProperties: false,
457+
},
444458
},
445459
}
446460

src/frame/tests/read-frontmatter.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,39 @@ I am content.
151151
}
152152
expect(errors[0]).toEqual(expectedError)
153153
})
154+
155+
test('creates errors if contributor metadata does not conform to schema', () => {
156+
const { errors } = parse(
157+
`---
158+
title: Title
159+
versions:
160+
fpt: '*'
161+
contributor:
162+
name: GitHub
163+
URL: not-a-url
164+
---`,
165+
{ schema: frontmatterSchema },
166+
)
167+
168+
expect(errors.length).toBe(1)
169+
expect(errors[0].property).toBe('contributor.URL.url')
170+
expect(errors[0].reason).toBe('format')
171+
})
172+
173+
test('passes if contributor metadata conforms to schema', () => {
174+
const { errors } = parse(
175+
`---
176+
title: Title
177+
versions:
178+
fpt: '*'
179+
contributor:
180+
name: GitHub
181+
URL: https://github.com
182+
---`,
183+
{ schema: frontmatterSchema },
184+
)
185+
186+
expect(errors.length).toBe(0)
187+
})
154188
})
155189
})

src/types/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ export type PageFrontmatter = {
6969
sidebarLink?: SidebarLink
7070
spotlight?: SpotlightItem[]
7171
filters?: Array<'category' | 'surface' | 'complexity'>
72+
contributor?: {
73+
name: string
74+
URL: string
75+
}
7276
}
7377

7478
type FeaturedLinks = {

0 commit comments

Comments
 (0)