mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
output additional links on all repos
This commit is contained in:
parent
208b9c1978
commit
7f896375f3
@ -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 => {
|
||||
const repositoriesGitHub =
|
||||
data.github.organization.repositories.edges
|
||||
const repositoriesYaml = data.allRepositoriesYaml.edges
|
||||
|
||||
// just iterate over all repos until we have a name match,
|
||||
// then return that repo, and then filter out all empty nodes
|
||||
@ -153,6 +168,20 @@ const Repository = ({ name, links, readme }) => (
|
||||
object
|
||||
} = 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 (
|
||||
<article className={styles.repository}>
|
||||
<Title name={name} releases={releases} url={url} />
|
||||
@ -160,7 +189,7 @@ const Repository = ({ name, links, readme }) => (
|
||||
<p>{!description ? '...' : description}</p>
|
||||
|
||||
<footer className={styles.repositoryMeta}>
|
||||
<Links links={links} url={url} />
|
||||
<Links links={moreLinks} url={url} />
|
||||
<Numbers
|
||||
stargazers={stargazers}
|
||||
forkCount={forkCount}
|
||||
|
Loading…
Reference in New Issue
Block a user