Skip to content

Commit 6fa29ab

Browse files
authored
Merge pull request #18214 from github/feat/add-contributor-frontmatter
Add support for new contributor frontmatter object
2 parents 54b7f16 + 2235827 commit 6fa29ab

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

content/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ See the [contributing docs](/CONTRIBUTING.md) for general information about work
2525
- [`includeGuides`](#includeGuides)
2626
- [`type`](#type)
2727
- [`topics`](#topics)
28+
- [`contributor`](#contributor)
2829
- [Escaping single quotes](#escaping-single-quotes)
2930
- [Autogenerated mini TOCs](#autogenerated-mini-tocs)
3031
- [Versioning](#versioning)
@@ -231,6 +232,18 @@ includeGuides:
231232
- Type: `String`
232233
- Optional.
233234

235+
### `contributor`
236+
- Purpose: Indicate an article is contributed and maintained by a third-party organization, typically a GitHub Technology Partner.
237+
- Type: `Object`. Properties are `name` and `URL`.
238+
- Optional.
239+
240+
Example:
241+
242+
```yml
243+
contributor:
244+
name: ACME, inc.
245+
URL: https://acme.example.com/
246+
```
234247

235248
### Escaping single quotes
236249

data/ui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ product_sublanding:
158158
learning_track_nav:
159159
prevGuide: Previous guide
160160
nextGuide: Next guide
161+
contributor_callout: This article is contributed and maintained by

includes/article.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ <h1 class="border-bottom-0">{{ page.title }}</h1>
2020
</div>
2121
</div>
2222

23+
{% if page.contributor %}
24+
<div class="contributor-callout border rounded-1 mb-4 p-3 border-blue bg-blue-light f5">
25+
<p><span class="mr-2">{% octicon "info" %}</span>{% data ui.contributor_callout %} <a href="{{ page.contributor.URL }}">{{ page.contributor.name }}</a>.</p>
26+
</div>
27+
{% endif %}
28+
2329
{% if page.intro %}
2430
<div class="lead-mktg">{{ page.intro }}</div>
2531
{% endif %}

lib/frontmatter.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ const schema = {
119119
defaultPlatform: {
120120
type: 'string',
121121
enum: ['mac', 'windows', 'linux']
122+
},
123+
// Documentation contributed by a third party, such as a GitHub Partner
124+
contributor: {
125+
type: 'object',
126+
properties: {
127+
name: { type: 'string' },
128+
URL: { type: 'string' }
129+
}
122130
}
123131
}
124132
}

stylesheets/overrides.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
color: $text-gray-dark;
6666
}
6767

68-
.product-callout p {
68+
.product-callout p, .contributor-callout p {
6969
margin: 0;
7070
}
7171

0 commit comments

Comments
 (0)