mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 17:05:50 +02:00
FIX Rewrite API links for the correct version.
CMS3 docs shouldn't link to CMS4 API, for example.
This commit is contained in:
parent
a0de65a48a
commit
4b9c88219b
@ -1,9 +1,11 @@
|
||||
import { getCurrentVersion } from './nodes';
|
||||
|
||||
/**
|
||||
* If an href is preceded with api:, rewrite it to the api.silverstripe.org site
|
||||
* @param link
|
||||
*/
|
||||
const rewriteAPILink = (link: string): string => {
|
||||
const version = 4;
|
||||
const version = getCurrentVersion();
|
||||
const match = link.match(/api\:(.*)/);
|
||||
if (!match) {
|
||||
console.error(`Unable to resolve api link ${link}!`);
|
||||
|
Loading…
Reference in New Issue
Block a user