diff --git a/CHANGELOG.md b/CHANGELOG.md index 497db0364..80eeb1b88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 4.1.0 / 2017-05-30 + + + * feat: Support server client renderer [See detail](//docsify.js.org/#/ssr) + * feat: Support HTML5 history API. `$docsify.routerMode = 'history'` + * Breaking change: Clean global API + ## 3.7.3 / 2017-05-22 * fix(render): find => filter, Compatible with old browser diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 60374a5e9..b4b3ebd98 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -18,5 +18,6 @@ - [Vue compatibility](vue.md) - [CDN](cdn.md) - [Offline Mode(PWA)](pwa.md) + - [(Server-client renderer(SSR)](ssr.md) - [Changelog](changelog.md) diff --git a/docs/configuration.md b/docs/configuration.md index 985391416..250d0b7a2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -317,7 +317,7 @@ window.$docsify = { ``` ## format-updated -We can display the file update date through **{docsify-updated}** variable. And format it by `formatUpdated`. +We can display the file update date through **{docsify-updated}** variable. And format it by `formatUpdated`. See https://github.com/lukeed/tinydate#patterns ```js window.$docsify = { @@ -340,3 +340,10 @@ window.$docsify = { externalLinkTarget: '_self' // default: '_blank' } ``` + +## router-mode +```js +window.$docsify = { + routerMode: 'history' // default: 'hash' +} +``` diff --git a/docs/de-de/_sidebar.md b/docs/de-de/_sidebar.md index dac8531ca..f992cca14 100644 --- a/docs/de-de/_sidebar.md +++ b/docs/de-de/_sidebar.md @@ -18,5 +18,6 @@ - [Vue Kompatibilität](de-de/vue.md) - [CDN](de-de/cdn.md) - [Offline Modus (PWA)](de-de/pwa.md) + - [Server-client renderer (SSR)](de-de/ssr.md) - [Changelog](de-de/changelog.md) diff --git a/docs/de-de/ssr.md b/docs/de-de/ssr.md new file mode 100644 index 000000000..ab5179359 --- /dev/null +++ b/docs/de-de/ssr.md @@ -0,0 +1,121 @@ +# Server client renderer + +See https://docsify.now.sh + +## Why SSR? +- Better SEO +- Feeling cool + +## Quick start + +Install `now` and `docsify-cli` in your project. + +```bash +npm i now -g +npm i docsify-cli -D +``` + +Edit `package.json`. If the documentation in `./docs` subdirectory. + +```json +{ + "name": "my-project", + "scripts": { + "start": "docsify start docs" + }, + "files": [ + "docs" + ], + "docsify": { + "config": { + "basePath": "/docs/", + "loadSidebar": true, + "loadNavbar": true, + "coverpage": true, + "name": "docsify" + } + } +} +``` + +!> The `basePath` just like webpack `publicPath`. You should config it if your docs is in the subdirectory. + +We can preview in the local to see if it works. + +```bash +npm start + +# open http://localhost:4000 +``` + +Publish it! + +```bash +now -p +``` + +Now, You have a support for SSR the docs site. + +## Custom template + +You can provide a templte for entire page's HTML. such as + +```html + + +
+ +