Skip to content

Commit d3c8598

Browse files
isaacsruyadorno
authored andcommitted
doc: Move @Version@ for html docs into gatsby
1 parent 4ff1bb1 commit d3c8598

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ htmldocs:
5252
cd docs && node ../bin/npm-cli.js install && \
5353
node ../bin/npm-cli.js run build:static echo>&2 && \
5454
rm -rf node_modules .cache public/*js public/*json public/404* public/page-data public/manifest*
55-
find docs/public -name '*.html' -exec \
56-
node scripts/docs-build.js {} \;
5755

5856
docs: mandocs htmldocs
5957

@@ -92,7 +90,7 @@ man/man1/npx.1: node_modules/libnpx/libnpx.1
9290
man/man5/npm-json.5: man/man5/package.json.5
9391
cp $< $@
9492

95-
man/man5/npm-global.5: man/man5/foslders.5
93+
man/man5/npm-global.5: man/man5/folders.5
9694
cp $< $@
9795

9896
man/man5/%.5: docs/content/configuring-npm/%.md scripts/docs-build.js package.json $(build-doc-tools)

docs/src/templates/Page.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import styled, { ThemeProvider } from 'styled-components'
55
import {theme} from 'src/theme'
66
import FoundTypo from 'src/components/FoundTypo'
77
import Scripts from 'src/components/Scripts'
8+
const version = require('../../../package.json').version
89

910
const Content = styled.div`
1011
max-width: 760px;
@@ -20,7 +21,9 @@ const Page = ({data}) => {
2021
<ThemeProvider theme={theme}>
2122
<Layout showSidebar>
2223
<Content className='documentation'>
23-
<div dangerouslySetInnerHTML={{ __html: html }} />
24+
<div dangerouslySetInnerHTML={{
25+
__html: html.replace(/@VERSION@/g, version)
26+
}} />
2427
<FoundTypo />
2528
<Scripts />
2629
</Content>

0 commit comments

Comments
 (0)