Compare commits

...
12 Commits
Author SHA1 Message Date
Joe PeaandGitHub 67a981b8d9 update docs for the name config option 2019-12-29 12:28:26 -08:00
AnixandGitHub d60fb7da7b Merge pull request #991 from anikethsaha/develop
chore: removed the escaping of the name of sidebar
2019-12-28 22:12:16 +05:30
anikethsaha 7d0c164bf5 chore: removed the escaping of the name of sidebar 2019-12-28 22:08:36 +05:30
James GeorgeandAnix 5b77b0f628 fix: stage modified files as part of pre-commit hook (#985) 2019-12-22 17:18:28 +05:30
cinwell.liandAnix 8416275e25 docs: about cache (#854) 2019-12-22 17:16:23 +05:30
Rodrigo AsensioandAnix 808123bc30 Added a redirect for images to show up in Amplify (#918)
Without the redirect images are not displaying in Amplify after deploying. Once added the redirect all PNGs showed up.
2019-12-20 17:42:53 +05:30
Thai PangsakulyanontandAnix daf54b9d36 There are currently {three=>four} themes available. (#892)
* There are currently {three=>four} themes available.

* Remove number
2019-12-20 17:42:39 +05:30
James GeorgeandAnix eea41a1207 feat(chore): configure pre-commit hook (#983)
* chore: add husky as a devDep

* chore: add lint-staged as a devDep

* configure: pre-commit hook for staged files

* fix: minor tweak

* chore: update glob
2019-12-19 14:08:21 +05:30
anikethsaha 3cd03d480d chore: add changelog 4.10.2 2019-12-17 03:20:41 +05:30
anikethsaha 9a90b9b927 [build] 4.10.2 2019-12-17 03:19:55 +05:30
AnixandGitHub 75919f1235 Merge pull request #979 from docsifyjs/opencollective-fix
fix: changed the opencollective cli to light
2019-12-17 03:05:08 +05:30
anikethsaha b0b3de0a66 chore: changed the opencollective cli to light 2019-12-17 02:48:47 +05:30
11 changed files with 860 additions and 211 deletions
+4
View File
@@ -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
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.10.0</small>
# docsify <small>4.10.2</small>
> A magical documentation site generator.
+20
View File
@@ -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
View File
@@ -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
View File
@@ -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">
+802 -173
View File
File diff suppressed because it is too large Load Diff
+17 -6
View File
@@ -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
View File
@@ -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
View File
@@ -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>`
-15
View File
@@ -57,18 +57,3 @@ export function isFn(obj) {
return typeof obj === 'function'
}
/**
* escape String
*/
export function escapeString(string) {
const entityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'\'': '&#39;',
'/': '&#x2F;'
}
return String(string).replace(/[&<>"'/]/g, s => entityMap[s])
}