Skip to content

Commit a83088e

Browse files
authored
Merge pull request #2266 from hashicorp/website-status-added
Website - Include support for “added” status for the components
2 parents 6601d64 + e8f632f commit a83088e

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

website/app/components/doc/cards/card.hbs

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<Doc::Badge class="doc-cards-card__badge" @type="warning-inverted" @size="medium">Deprecated</Doc::Badge>
1414
{{else if @status.updated}}
1515
<Doc::Badge class="doc-cards-card__badge" @type="neutral-inverted" @size="medium">Updated</Doc::Badge>
16+
{{else if @status.added}}
17+
<Doc::Badge class="doc-cards-card__badge" @type="information-inverted" @size="medium">Added</Doc::Badge>
1618
{{/if}}
1719
<p class="doc-cards-card_description">{{@caption}}</p>
1820
</div>
@@ -27,6 +29,8 @@
2729
<Doc::Badge class="doc-cards-card__badge" @type="warning-inverted" @size="medium">Deprecated</Doc::Badge>
2830
{{else if @status.updated}}
2931
<Doc::Badge class="doc-cards-card__badge" @type="neutral-inverted" @size="medium">Updated</Doc::Badge>
32+
{{else if @status.added}}
33+
<Doc::Badge class="doc-cards-card__badge" @type="information-inverted" @size="medium">Added</Doc::Badge>
3034
{{/if}}
3135
<p class="doc-cards-card_description">{{@caption}}</p>
3236
</div>

website/app/components/doc/table-of-contents/index.hbs

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
<Doc::Badge @type="warning-inverted" @size="medium">Deprecated</Doc::Badge>
2525
{{else if item.pageAttributes.status.updated}}
2626
<Doc::Badge @type="neutral-inverted" @size="medium">Updated</Doc::Badge>
27+
{{else if item.pageAttributes.status.added}}
28+
<Doc::Badge @type="information-inverted" @size="medium">Added</Doc::Badge>
2729
{{/if}}
2830
{{/if}}
2931
</LinkTo>

website/app/controllers/show.js

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ export default class ShowController extends Controller {
9898
type = 'neutral';
9999
label = 'Updated';
100100
version = this.model.frontmatter?.status?.updated;
101+
} else if (this.model.frontmatter?.status?.added) {
102+
type = 'information';
103+
label = 'Added';
104+
version = this.model.frontmatter?.status?.added;
101105
}
102106
if (version.match(/^\d+\.\d+\.\d+$/)) {
103107
label += ` in v${version}`;

wiki/Website-Doc-folder.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ The "frontmatter" attributes that we support are the following:
152152
An optional full path to an image used when listing the page as "card" (eg. in landing pages). The path refers to the `dist` folder generated at build time, so is relative to the content of the `/website/public` folder.
153153
* `status`
154154
An optional status of the component (that will be reflected in the pages with specific badges next to the component card or name)
155-
* `deprecated` - the version number in which the component has been deprecated (in the format `x.y.z`)
156-
* `updated` - the version number in which the component has been updated (in the format `x.y.z`) - notice: this can be removed after some time, when the changes are not anymore recent enough to justify the extra information
155+
* `added` | `updated` | `deprecated` - the version number in which the component has been added, updated or deprecated (in the format `x.y.z`)
156+
Notice: it should be removed after some time, when the changes are not anymore recent enough to justify the extra information
157157

158158
Only the `title` attribute is technically required, all the others are optional (even though some of them like `description` and `caption` are necessary for component pages).
159159

0 commit comments

Comments
 (0)