Skip to content

Commit

Permalink
doc: Move @Version@ for html docs into gatsby
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs authored and ruyadorno committed Nov 5, 2019
1 parent 4ff1bb1 commit d3c8598
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion docs/src/templates/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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>
Expand Down

0 comments on commit d3c8598

Please # to comment.