Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
⭐ new: doc module versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Feb 16, 2017
1 parent a6230e9 commit bbcb6bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions template/config/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require('fs')
const pack = require('../package.json')

// update installation.md
const installation = fs
.readFileSync('./gitbook/installation.md', 'utf-8')
.replace(
/<script src="https:\/\/unpkg\.com\/{{ name }}@[\d.]+.[\d]+\/dist\/{{ name }}\.min\.js"><\/script>/,
'<script src="https://unpkg.com/{{ name }}@' + pack.version + '/dist/{{ name }}.min.js"></script>'
)
fs.writeFileSync('./gitbook/installation.md', installation)
6 changes: 6 additions & 0 deletions template/gitbook/en/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Installation

### CDN
unpkg
```html
<script src="https://unpkg.com/{{ name }}@{{ version }}/dist/{{ name }}.min.js"></script>
```

{{#unless_eq githubAccount ""}}
## Direct Download

Expand Down

0 comments on commit bbcb6bc

Please sign in to comment.