1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

add docs footer, edit on github link

This commit is contained in:
Matthias Kretschmann 2018-11-09 14:42:47 +01:00
parent 96265db342
commit 3930976fd7
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,21 @@
import React from 'react'
import PropTypes from 'prop-types'
import styles from './DocFooter.module.scss'
const DocFooter = ({ post }) => (
<footer className={styles.footer}>
<a
href={`https://github.com/oceanprotocol/docs/blob/master/content/${
post.parent.relativePath
}`}
>
Edit on GitHub
</a>
</footer>
)
DocFooter.propTypes = {
post: PropTypes.object.isRequired
}
export default DocFooter

View File

@ -0,0 +1,17 @@
@import 'variables';
.footer {
margin-top: $spacer;
padding-top: $spacer;
margin-bottom: $spacer;
padding-bottom: $spacer;
border-top: .1rem solid $brand-grey-lighter;
font-size: $font-size-small;
text-align: center;
a {
font-family: $font-family-button;
text-transform: uppercase;
color: $brand-grey-light;
}
}

View File

@ -5,6 +5,7 @@ import Layout from '../components/Layout'
import Content from '../components/Content' import Content from '../components/Content'
import HeaderSection from '../components/HeaderSection' import HeaderSection from '../components/HeaderSection'
import Sidebar from '../components/Sidebar' import Sidebar from '../components/Sidebar'
import DocFooter from '../components/DocFooter'
import styles from './Doc.module.scss' import styles from './Doc.module.scss'
export default class DocTemplate extends Component { export default class DocTemplate extends Component {
@ -57,6 +58,8 @@ export default class DocTemplate extends Component {
__html: post.html __html: post.html
}} }}
/> />
<DocFooter post={post} />
</article> </article>
</main> </main>
) : ( ) : (
@ -74,6 +77,8 @@ export default class DocTemplate extends Component {
__html: post.html __html: post.html
}} }}
/> />
<DocFooter post={post} />
</article> </article>
)} )}
</Content> </Content>
@ -94,6 +99,7 @@ export const pageQuery = graphql`
id id
excerpt excerpt
html html
fileAbsolutePath
frontmatter { frontmatter {
title title
description description
@ -101,6 +107,7 @@ export const pageQuery = graphql`
fields { fields {
section section
} }
...PageFooter
} }
allSectionsYaml { allSectionsYaml {
@ -113,4 +120,12 @@ export const pageQuery = graphql`
} }
} }
} }
fragment PageFooter on MarkdownRemark {
parent {
... on File {
relativePath
}
}
}
` `