mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-10 05:48:18 +10:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67a981b8d9 | ||
|
|
d60fb7da7b | ||
|
|
7d0c164bf5 | ||
|
|
5b77b0f628 | ||
|
|
8416275e25 | ||
|
|
808123bc30 | ||
|
|
daf54b9d36 | ||
|
|
eea41a1207 | ||
|
|
3cd03d480d | ||
|
|
9a90b9b927 | ||
|
|
75919f1235 | ||
|
|
b0b3de0a66 |
@@ -1,3 +1,7 @@
|
||||
## [4.10.2](https://github.com/docsifyjs/docsify/compare/v4.10.0...v4.10.2) (2019-12-16)
|
||||
|
||||
|
||||
|
||||
# [4.10.0](https://github.com/docsifyjs/docsify/compare/v4.9.4...v4.10.0) (2019-12-16)
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>4.10.0</small>
|
||||
# docsify <small>4.10.2</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
@@ -239,6 +239,14 @@ window.$docsify = {
|
||||
};
|
||||
```
|
||||
|
||||
The name field can also contain custom HTML for easier customization:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
name: '<span>docsify</span>'
|
||||
};
|
||||
```
|
||||
|
||||
## nameLink
|
||||
|
||||
- Type: `String`
|
||||
@@ -480,6 +488,18 @@ window.$docsify = {
|
||||
};
|
||||
```
|
||||
|
||||
Such as setting the cache
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
requestHeaders: {
|
||||
'cache-control': 'max-age=600'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
|
||||
## ext
|
||||
|
||||
- type: `String`
|
||||
|
||||
+2
-1
@@ -128,9 +128,10 @@ frontend:
|
||||
|
||||
```
|
||||
|
||||
6. Add the following Redirect rules in their displayed order.
|
||||
6. Add the following Redirect rules in their displayed order. Note that the second record is a PNG image where you can change it with any image format you are using.
|
||||
|
||||
| Source address | Target address | Type |
|
||||
|----------------|----------------|---------------|
|
||||
| /<*>.md | /<*>.md | 200 (Rewrite) |
|
||||
| /<*>.png | /<*>.png | 200 (Rewrite) |
|
||||
| /<*> | /index.html | 200 (Rewrite) |
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Themes
|
||||
|
||||
There are currently three themes available. Copy [Vue](//vuejs.org) and [buble](//buble.surge.sh) website custom theme and [@liril-net](https://github.com/liril-net) contribution to the theme of the black style.
|
||||
There is a handful of themes available, both official and community-made. Copy [Vue](//vuejs.org) and [buble](//buble.surge.sh) website custom theme and [@liril-net](https://github.com/liril-net) contribution to the theme of the black style.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
|
||||
Generated
+802
-173
File diff suppressed because it is too large
Load Diff
+17
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.10.0",
|
||||
"version": "4.10.2",
|
||||
"description": "A magical documentation generator.",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
@@ -39,11 +39,23 @@
|
||||
"build": "rimraf lib themes && run-s build:js build:css build:css:min build:ssr build:cover",
|
||||
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
|
||||
"pub": "sh build/release.sh",
|
||||
"postinstall": "opencollective postinstall"
|
||||
"postinstall": "opencollective-postinstall"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"npm run lint",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"marked": "^0.7.0",
|
||||
"medium-zoom": "^1.0.4",
|
||||
"opencollective-postinstall": "^2.0.2",
|
||||
"prismjs": "^1.15.0",
|
||||
"tinydate": "^1.0.0",
|
||||
"tweezer.js": "^1.4.0"
|
||||
@@ -58,13 +70,14 @@
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-xo-space": "^0.21.0",
|
||||
"esm": "^3.1.4",
|
||||
"husky": "^3.1.0",
|
||||
"jsdom": "^15.1.1",
|
||||
"lerna": "^3.17.0",
|
||||
"lint-staged": "^9.5.0",
|
||||
"live-server": "^1.2.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mocha": "^5.2.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"opencollective": "^1.0.3",
|
||||
"rimraf": "^3.0.0",
|
||||
"rollup": "^1.23.1",
|
||||
"rollup-plugin-async": "^1.2.0",
|
||||
@@ -83,8 +96,6 @@
|
||||
"generator"
|
||||
],
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/docsify",
|
||||
"logo": "https://docsify.js.org/_media/icon.svg"
|
||||
"url": "https://opencollective.com/docsify"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.10.0",
|
||||
"version": "4.10.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.10.0",
|
||||
"version": "4.10.2",
|
||||
"description": "docsify server renderer",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
|
||||
+11
-12
@@ -1,5 +1,4 @@
|
||||
import {isMobile} from '../util/env'
|
||||
import {escapeString} from '../util/core'
|
||||
import { isMobile } from '../util/env'
|
||||
/**
|
||||
* Render github corner
|
||||
* @param {Object} data
|
||||
@@ -9,11 +8,13 @@ export function corner(data, cornerExternalLinkTarge) {
|
||||
if (!data) {
|
||||
return ''
|
||||
}
|
||||
|
||||
if (!/\/\//.test(data)) {
|
||||
data = 'https://github.com/' + data
|
||||
}
|
||||
|
||||
data = data.replace(/^git\+/, '')
|
||||
// double check
|
||||
// Double check
|
||||
cornerExternalLinkTarge = cornerExternalLinkTarge || '_blank'
|
||||
|
||||
return (
|
||||
@@ -31,8 +32,7 @@ export function corner(data, cornerExternalLinkTarge) {
|
||||
* Render main content
|
||||
*/
|
||||
export function main(config) {
|
||||
|
||||
const name = config.name? escapeString(config.name):''
|
||||
const name = config.name ? config.name : ''
|
||||
|
||||
const aside =
|
||||
'<button class="sidebar-toggle" aria-label="Menu">' +
|
||||
@@ -41,13 +41,11 @@ export function main(config) {
|
||||
'</div>' +
|
||||
'</button>' +
|
||||
'<aside class="sidebar">' +
|
||||
(config.name ?
|
||||
`<h1 class="app-name"><a class="app-name-link" data-nosearch>${
|
||||
config.logo ?
|
||||
`<img alt="${name}" src=${config.logo}>` :
|
||||
name
|
||||
}</a></h1>` :
|
||||
'') +
|
||||
(config.name
|
||||
? `<h1 class="app-name"><a class="app-name-link" data-nosearch>${
|
||||
config.logo ? `<img alt="${name}" src=${config.logo}>` : name
|
||||
}</a></h1>`
|
||||
: '') +
|
||||
'<div class="sidebar-nav"><!--sidebar--></div>' +
|
||||
'</aside>'
|
||||
|
||||
@@ -88,6 +86,7 @@ export function tree(toc, tpl = '<ul class="app-sub-sidebar">{inner}</ul>') {
|
||||
if (!toc || !toc.length) {
|
||||
return ''
|
||||
}
|
||||
|
||||
let innerHTML = ''
|
||||
toc.forEach(node => {
|
||||
innerHTML += `<li><a class="section-link" href="${node.slug}">${node.title}</a></li>`
|
||||
|
||||
@@ -57,18 +57,3 @@ export function isFn(obj) {
|
||||
return typeof obj === 'function'
|
||||
}
|
||||
|
||||
/**
|
||||
* escape String
|
||||
*/
|
||||
export function escapeString(string) {
|
||||
const entityMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
'\'': ''',
|
||||
'/': '/'
|
||||
}
|
||||
|
||||
return String(string).replace(/[&<>"'/]/g, s => entityMap[s])
|
||||
}
|
||||
Reference in New Issue
Block a user