mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Merge pull request #49 from oceanprotocol/fix/48
output additional links on all repos
This commit is contained in:
commit
fa04cfb9d7
@ -27,7 +27,7 @@
|
|||||||
- [Repositories](#repositories)
|
- [Repositories](#repositories)
|
||||||
- [Development](#development)
|
- [Development](#development)
|
||||||
- [Using npm](#using-npm)
|
- [Using npm](#using-npm)
|
||||||
- [Using Docker](#use-docker)
|
- [Using Docker](#using-docker)
|
||||||
- [Linting & Formatting](#linting--formatting)
|
- [Linting & Formatting](#linting--formatting)
|
||||||
- [Editor Setup: VS Code](#editor-setup-vs-code)
|
- [Editor Setup: VS Code](#editor-setup-vs-code)
|
||||||
- [GitHub GraphQL API](#github-graphql-api)
|
- [GitHub GraphQL API](#github-graphql-api)
|
||||||
@ -166,7 +166,7 @@ Additionally, you can attach multiple links to a repo. The GitHub link is automa
|
|||||||
url: https://github.com/oceanprotocol/keeper-contracts/tree/develop/doc
|
url: https://github.com/oceanprotocol/keeper-contracts/tree/develop/doc
|
||||||
```
|
```
|
||||||
|
|
||||||
in [`/data/repositories.yml`](data/repositories.yml).
|
in [`/data/repositories.yml`](data/repositories.yml). The links defined in this file will also be used to enhance the display of the repository component on all other pages.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
@ -5,24 +5,6 @@ description: On this site, Markdown is transformed to HTML through Remark follow
|
|||||||
|
|
||||||
For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/).
|
For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/).
|
||||||
|
|
||||||
## Table of Contents
|
|
||||||
|
|
||||||
- [Headers](#header)
|
|
||||||
- [Emphasis](#emphasis)
|
|
||||||
- [Lists](#lists)
|
|
||||||
- [Links](#links)
|
|
||||||
- [Images](#images)
|
|
||||||
- [Code and Syntax Highlighting](#code-and-syntax-highlighting)
|
|
||||||
- [Tables](#tables)
|
|
||||||
- [Blockquotes](#blockquotes)
|
|
||||||
- [Inline HTML](#inline-html)
|
|
||||||
- [Horizontal Rule](#horizontal-rule)
|
|
||||||
- [Line Breaks](#line-breaks)
|
|
||||||
- [Videos](#videos)
|
|
||||||
- [React Components in Markdown](#react-components-in-markdown)
|
|
||||||
- [Repository Component](#repository-component)
|
|
||||||
- [Embedding File Contents from GitHub](#embedding-file-contents-from-github)
|
|
||||||
|
|
||||||
## Headers
|
## Headers
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@ -347,7 +329,7 @@ Or, in pure Markdown, but losing the image sizing and border:
|
|||||||
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg)](http://www.youtube.com/watch?v=YOUTUBE_VIDEO_ID_HERE)
|
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg)](http://www.youtube.com/watch?v=YOUTUBE_VIDEO_ID_HERE)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Repository Component
|
## GitHub Repository Component
|
||||||
|
|
||||||
In all Markdown docs you can use some select React Components. This magic is done with [gatsby-remark-component](https://www.gatsbyjs.org/packages/gatsby-remark-component/).
|
In all Markdown docs you can use some select React Components. This magic is done with [gatsby-remark-component](https://www.gatsbyjs.org/packages/gatsby-remark-component/).
|
||||||
|
|
||||||
|
@ -44,6 +44,20 @@ const queryGithub = graphql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allRepositoriesYaml {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
items {
|
||||||
|
name
|
||||||
|
links {
|
||||||
|
name
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
@ -129,6 +143,7 @@ const Repository = ({ name, links, readme }) => (
|
|||||||
render={data => {
|
render={data => {
|
||||||
const repositoriesGitHub =
|
const repositoriesGitHub =
|
||||||
data.github.organization.repositories.edges
|
data.github.organization.repositories.edges
|
||||||
|
const repositoriesYaml = data.allRepositoriesYaml.edges
|
||||||
|
|
||||||
// just iterate over all repos until we have a name match,
|
// just iterate over all repos until we have a name match,
|
||||||
// then return that repo, and then filter out all empty nodes
|
// then return that repo, and then filter out all empty nodes
|
||||||
@ -153,6 +168,20 @@ const Repository = ({ name, links, readme }) => (
|
|||||||
object
|
object
|
||||||
} = repo
|
} = repo
|
||||||
|
|
||||||
|
// enhance passed links array with what's in repositories.yml,
|
||||||
|
// iterating over all repos until we have a name match
|
||||||
|
const linksFilteredArray = repositoriesYaml.map(({ node }) => {
|
||||||
|
return node.items
|
||||||
|
.map(item => {
|
||||||
|
if (item.name === name) {
|
||||||
|
return item.links
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.filter(n => n)[0]
|
||||||
|
})
|
||||||
|
|
||||||
|
const moreLinks = links || linksFilteredArray[0]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article className={styles.repository}>
|
<article className={styles.repository}>
|
||||||
<Title name={name} releases={releases} url={url} />
|
<Title name={name} releases={releases} url={url} />
|
||||||
@ -160,7 +189,7 @@ const Repository = ({ name, links, readme }) => (
|
|||||||
<p>{!description ? '...' : description}</p>
|
<p>{!description ? '...' : description}</p>
|
||||||
|
|
||||||
<footer className={styles.repositoryMeta}>
|
<footer className={styles.repositoryMeta}>
|
||||||
<Links links={links} url={url} />
|
<Links links={moreLinks} url={url} />
|
||||||
<Numbers
|
<Numbers
|
||||||
stargazers={stargazers}
|
stargazers={stargazers}
|
||||||
forkCount={forkCount}
|
forkCount={forkCount}
|
||||||
|
Loading…
Reference in New Issue
Block a user