Skip to content

Commit 467052e

Browse files
author
Taylor Payne
committed
docs: add section on how to customize external links
1 parent 6a59e25 commit 467052e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ const ExampleComponent = () => {
113113
};
114114
```
115115

116+
#### Overriding default external links
117+
118+
A `getExternalLinkUrl` function is provided in `config.js` which can be used to override default external links. To make use of this function, provide an object that maps default links to custom links. This object should be added to the `config` object defined in the `env.config.[js,jsx,ts,tsx]`, and must be named `externalLinkUrlOverrides`. Here is an example:
119+
120+
```js
121+
// env.config.js
122+
123+
const config = {
124+
// other custom configuration here
125+
externalLinkUrlOverrides: {
126+
"https://docs.openedx.org/en/latest/educators/index.html": "https://custom.example.com/educators/index.html",
127+
"https://creativecommons.org/licenses": "https://www.tldrlegal.com/license/creative-commons-attribution-cc",
128+
},
129+
};
130+
131+
export default config;
132+
```
133+
116134
### Service interfaces
117135

118136
Each service (analytics, auth, i18n, logging) provided by frontend-platform has an API contract which all implementations of that service are guaranteed to fulfill. Applications that use frontend-platform can use its configured services via a convenient set of exported functions. An application that wants to use the service interfaces need only initialize them via the initialize() function, optionally providing custom service interfaces as desired (you probably won't need to).

0 commit comments

Comments
 (0)