diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2019-11-05 14:55:08 -0500 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-11-09 20:13:43 -0800 |
commit | 4b97c3addb246274cd7e8432edd537e0bdf60b63 (patch) | |
tree | 9f859239c3b38b04ddc58ee736bf6b2caf6008a5 /deps/npm/docs/src/templates/Page.js | |
parent | 5f9794ea9aaaf5597974a65460e1f3069f68475f (diff) | |
download | node-new-4b97c3addb246274cd7e8432edd537e0bdf60b63.tar.gz |
deps: update npm to 6.13.0
PR-URL: https://github.com/nodejs/node/pull/30271
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps/npm/docs/src/templates/Page.js')
-rw-r--r-- | deps/npm/docs/src/templates/Page.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/deps/npm/docs/src/templates/Page.js b/deps/npm/docs/src/templates/Page.js new file mode 100644 index 0000000000..bd7d6a01ca --- /dev/null +++ b/deps/npm/docs/src/templates/Page.js @@ -0,0 +1,46 @@ +import React from 'react' +import Layout from 'src/components/Layout' +import {graphql} from 'gatsby' +import styled, { ThemeProvider } from 'styled-components' +import {theme} from 'src/theme' +import FoundTypo from 'src/components/FoundTypo' +import Scripts from 'src/components/Scripts' +const version = require('../../../package.json').version + +const Content = styled.div` + max-width: 760px; + margin: auto; + padding: 0 30px 120px; +` + +const Page = ({data}) => { + const pageData = data.markdownRemark + const html = pageData.html.replace(/(npm-)+([a-zA-Z\\.-]*)<\/h1>/g, 'npm $2</h1>') + + return ( + <ThemeProvider theme={theme}> + <Layout showSidebar> + <Content className='documentation'> + <div dangerouslySetInnerHTML={{ + __html: html.replace(/@VERSION@/g, version) + }} /> + <FoundTypo /> + <Scripts /> + </Content> + </Layout> + </ThemeProvider> + ) +} + +export default Page + +export const query = graphql` + query($slug: String!) { + markdownRemark(fields: { slug: { eq: $slug } }) { + html + fields { + slug + } + } + } +` |