2023-03-15 16:00:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2022-11-11 15:56:44 +00:00
|
|
|
import ExternalLink from './external-link';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2019-05-13 19:05:25 +00:00
|
|
|
/**
|
|
|
|
* @module DocLink
|
2023-01-10 17:07:08 +00:00
|
|
|
* `DocLink` components are used to render anchor links to relevant Vault documentation at developer.hashicorp.com.
|
2019-05-13 19:05:25 +00:00
|
|
|
*
|
|
|
|
* @example
|
|
|
|
* ```js
|
|
|
|
<DocLink @path="/docs/secrets/kv/kv-v2.html">Learn about KV v2</DocLink>
|
|
|
|
* ```
|
|
|
|
*
|
2023-01-10 17:07:08 +00:00
|
|
|
* @param {string} path="/" - The path to documentation on developer.hashicorp.com that the component should link to.
|
2019-05-13 19:05:25 +00:00
|
|
|
*
|
|
|
|
*/
|
2022-11-11 15:56:44 +00:00
|
|
|
export default class DocLinkComponent extends ExternalLink {
|
2022-12-14 23:25:16 +00:00
|
|
|
host = 'https://developer.hashicorp.com';
|
2019-05-13 19:05:25 +00:00
|
|
|
|
2022-11-11 15:56:44 +00:00
|
|
|
get href() {
|
|
|
|
return `${this.host}${this.args.path}`;
|
|
|
|
}
|
|
|
|
}
|