From 25ec4cf7b04bc58cf192566ea680d426dba2bff1 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Nov 2017 10:25:53 -0600 Subject: Fix source links in 0x.js docs --- packages/website/ts/pages/documentation/source_link.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/pages/documentation/source_link.tsx b/packages/website/ts/pages/documentation/source_link.tsx index 2fb69e2f0..08d372743 100644 --- a/packages/website/ts/pages/documentation/source_link.tsx +++ b/packages/website/ts/pages/documentation/source_link.tsx @@ -8,10 +8,13 @@ interface SourceLinkProps { version: string; } +const SUB_PKG = '0x.js'; + export function SourceLink(props: SourceLinkProps) { - const source = props.source; - const githubUrl = constants.GITHUB_0X_JS_URL; - const sourceCodeUrl = `${githubUrl}/blob/v${props.version}/${source.fileName}#L${source.line}`; + const src = props.source; + const url = constants.GITHUB_0X_JS_URL; + // https://github.com/0xProject/0x.js/blob/0x.js%400.26.1/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts + const sourceCodeUrl = `${url}/blob/${SUB_PKG}%40${props.version}/packages/${SUB_PKG}/${src.fileName}#L${src.line}`; return (