diff options
author | isaacs <i@izs.me> | 2019-11-05 21:14:35 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2019-11-05 22:14:36 +0300 |
commit | d3c859883abbdeb0ee6bb93ebb3a980a602dfff4 (patch) | |
tree | bfacbca34d62c9b1a4a3348d72c5cd2e181d64ca | |
parent | 4ff1bb180b1db8c72e51b3d57bd4e268b738e049 (diff) |
doc: Move @VERSION@ for html docs into gatsby
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | docs/src/templates/Page.js | 5 |
2 files changed, 5 insertions, 4 deletions
@@ -52,8 +52,6 @@ htmldocs: cd docs && node ../bin/npm-cli.js install && \ node ../bin/npm-cli.js run build:static echo>&2 && \ rm -rf node_modules .cache public/*js public/*json public/404* public/page-data public/manifest* - find docs/public -name '*.html' -exec \ - node scripts/docs-build.js {} \; docs: mandocs htmldocs @@ -92,7 +90,7 @@ man/man1/npx.1: node_modules/libnpx/libnpx.1 man/man5/npm-json.5: man/man5/package.json.5 cp $< $@ -man/man5/npm-global.5: man/man5/foslders.5 +man/man5/npm-global.5: man/man5/folders.5 cp $< $@ man/man5/%.5: docs/content/configuring-npm/%.md scripts/docs-build.js package.json $(build-doc-tools) diff --git a/docs/src/templates/Page.js b/docs/src/templates/Page.js index a79abf171..bd7d6a01c 100644 --- a/docs/src/templates/Page.js +++ b/docs/src/templates/Page.js @@ -5,6 +5,7 @@ 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; @@ -20,7 +21,9 @@ const Page = ({data}) => { <ThemeProvider theme={theme}> <Layout showSidebar> <Content className='documentation'> - <div dangerouslySetInnerHTML={{ __html: html }} /> + <div dangerouslySetInnerHTML={{ + __html: html.replace(/@VERSION@/g, version) + }} /> <FoundTypo /> <Scripts /> </Content> |