|
1 | 1 | # CDN
|
2 | 2 |
|
3 |
| -Recommended: [jsDelivr](//cdn.jsdelivr.net), which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at [cdn.jsdelivr.net/npm/docsify/](//cdn.jsdelivr.net/npm/docsify/). |
| 3 | +The docsify [npm package](https://www.npmjs.com/package/docsify) is auto-published to CDNs with each release. The contents can be viewed on each CDN. |
4 | 4 |
|
5 |
| -## Latest version |
| 5 | +Docsify recommends [jsDelivr](//cdn.jsdelivr.net) as its preferred CDN: |
6 | 6 |
|
7 |
| -```html |
8 |
| -<!-- load css --> |
9 |
| -<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css" /> |
| 7 | +- https://cdn.jsdelivr.net/npm/docsify/ |
10 | 8 |
|
11 |
| -<!-- load script --> |
12 |
| -<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.js"></script> |
13 |
| -``` |
| 9 | +Other CDNs are available and may be required in locations where jsDelivr is not available: |
14 | 10 |
|
15 |
| -Alternatively, use [compressed files](#compressed-file). |
| 11 | +- https://cdnjs.com/libraries/docsify |
| 12 | +- https://unpkg.com/browse/docsify/ |
| 13 | +- https://www.bootcdn.cn/docsify/ |
16 | 14 |
|
17 |
| -## Specific version |
| 15 | +## Specifying versions |
18 | 16 |
|
19 |
| -```html |
20 |
| -<!-- load css --> |
21 |
| -<link |
22 |
| - rel="stylesheet" |
23 |
| - href= "//cdn.jsdelivr.net/npm/[email protected]/themes/vue.css" |
24 |
| -/> |
25 |
| - |
26 |
| -<!-- load script --> |
27 |
| -< script src= "//cdn.jsdelivr.net/npm/[email protected]/lib/docsify.js"></ script> |
28 |
| -``` |
| 17 | +Note the `@` version lock in the CDN URLs below. This allows specifying the latest major, minor, patch, or specific [semver](https://semver.org) version number. |
29 | 18 |
|
30 |
| -## Compressed file |
| 19 | +- MAJOR versions include breaking changes<br> |
| 20 | + `1.0.0` → `2.0.0` |
| 21 | +- MINOR versions include non-breaking new functionality<br> |
| 22 | + `1.0.0` → `1.1.0` |
| 23 | +- PATCH versions include non-breaking bug fixes<br> |
| 24 | + `1.0.0` → `1.0.1` |
31 | 25 |
|
32 |
| -```html |
33 |
| -<!-- load css --> |
34 |
| -<link |
35 |
| - rel="stylesheet" |
36 |
| - href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" |
37 |
| -/> |
38 |
| - |
39 |
| -<!-- load script --> |
40 |
| -<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script> |
41 |
| -``` |
| 26 | +Uncompressed resources are available by omitting the `.min` from the filename. |
| 27 | + |
| 28 | +## Latest "major" version |
| 29 | + |
| 30 | +Specifying the latest major version allows your site to receive all non-breaking enhancements ("minor" updates) and bug fixes ("patch" updates) as they are released. This is good option for those who prefer a zero-maintenance way of keeping their site up to date with minimal risk as new versions are published. |
42 | 31 |
|
| 32 | +?> When a new major version is released, you will need to manually update the major version number after the `@` symbol in your CDN URLs. |
| 33 | + |
| 34 | +<!-- prettier-ignore --> |
43 | 35 | ```html
|
44 |
| -<!-- load css --> |
45 |
| -<link |
46 |
| - rel="stylesheet" |
47 |
| - href= "//cdn.jsdelivr.net/npm/[email protected]/lib/themes/vue.css" |
48 |
| -/> |
49 |
| - |
50 |
| -<!-- load script --> |
51 |
| -< script src= "//cdn.jsdelivr.net/npm/[email protected]/lib/docsify.min.js"></ script> |
| 36 | +<!-- Theme --> |
| 37 | +<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@5/themes/vue.min.css" /> |
| 38 | + |
| 39 | +<!-- Docsify --> |
| 40 | +<script src="//cdn.jsdelivr.net/npm/docsify@5/dist/docsify.min.js"></script> |
52 | 41 | ```
|
53 | 42 |
|
54 |
| -## Other CDN |
| 43 | +## Specific version |
55 | 44 |
|
56 |
| -- https://www.bootcdn.cn/docsify/ |
57 |
| -- https://cdn.jsdelivr.net/npm/docsify/ |
58 |
| -- https://cdnjs.com/libraries/docsify |
59 |
| -- https://unpkg.com/browse/docsify/ |
| 45 | +Specifying an exact version prevents any future updates from affecting your site. This is good option for those who prefer to manually update their resources as new versions are published. |
| 46 | + |
| 47 | +?> When a new version is released, you will need to manually update the version number after the `@` symbol in your CDN URLs. |
| 48 | + |
| 49 | +<!-- prettier-ignore --> |
| 50 | +```html |
| 51 | +<!-- Theme --> |
| 52 | +< link rel= "stylesheet" href= "//cdn.jsdelivr.net/npm/[email protected]/themes/vue.min.css" /> |
| 53 | + |
| 54 | +<!-- Docsify --> |
| 55 | +< script src= "//cdn.jsdelivr.net/npm/[email protected]/dist/docsify.min.js"></ script> |
| 56 | +``` |
0 commit comments