diff --git a/config.js b/config.js index fb848472..0b586a03 100644 --- a/config.js +++ b/config.js @@ -14,5 +14,9 @@ module.exports = { twitter: 'https://twitter.com/oceanprotocol', gitter: 'https://gitter.im/oceanprotocol/Lobby', telegram: 'https://t.me/joinchat/GUyxrE0Hi154D0NrlOqLFg' - } + }, + githubContentPath: + 'https://github.com/oceanprotocol/docs/blob/master/content', + githubDevOceanPath: + 'https://github.com/oceanprotocol/dev-ocean/blob/master/doc' } diff --git a/external/dev-ocean b/external/dev-ocean index 491619c1..6bbf269d 160000 --- a/external/dev-ocean +++ b/external/dev-ocean @@ -1 +1 @@ -Subproject commit 491619c170b4d0bd3ab9bede26316ec6f80f4b84 +Subproject commit 6bbf269da9eaf75c0fd42bd2a71944af52db6f04 diff --git a/src/components/DocFooter.jsx b/src/components/DocFooter.jsx index 3aa32086..fe2eedf3 100644 --- a/src/components/DocFooter.jsx +++ b/src/components/DocFooter.jsx @@ -2,20 +2,39 @@ import React from 'react' import PropTypes from 'prop-types' import { ReactComponent as Pencil } from '../images/pencil.svg' import styles from './DocFooter.module.scss' +import { githubContentPath, githubDevOceanPath } from '../../config' -const githubContentPath = - 'https://github.com/oceanprotocol/docs/blob/master/content' +const DocFooter = ({ post }) => { + const { sourceInstanceName } = post.parent -const DocFooter = ({ post }) => ( - -) + let path + let externalRepoName + + switch (sourceInstanceName) { + case 'dev-ocean': + path = githubDevOceanPath + externalRepoName = sourceInstanceName + break + default: + path = githubContentPath + } + + return ( + + ) +} DocFooter.propTypes = { post: PropTypes.object.isRequired diff --git a/src/components/DocFooter.module.scss b/src/components/DocFooter.module.scss index d567bb69..b9e5b331 100644 --- a/src/components/DocFooter.module.scss +++ b/src/components/DocFooter.module.scss @@ -30,3 +30,11 @@ .active { color: $brand-pink !important; // stylelint-disable-line declaration-no-important } + +.externalRepoName { + font-family: $font-family-monospace; + font-weight: $font-weight-base; + font-size: $font-size-mini; + text-transform: none; + margin-left: $spacer / 4; +} diff --git a/src/templates/Doc.jsx b/src/templates/Doc.jsx index 3e9220ca..4ab5513b 100644 --- a/src/templates/Doc.jsx +++ b/src/templates/Doc.jsx @@ -101,11 +101,9 @@ export const pageQuery = graphql` query DocBySlug($slug: String!) { markdownRemark(fields: { slug: { eq: $slug } }) { id - excerpt tableOfContents html htmlAst - fileAbsolutePath frontmatter { title description @@ -131,6 +129,7 @@ export const pageQuery = graphql` parent { ... on File { relativePath + sourceInstanceName } } }