"
);
}
return this.origin.code.apply(this, arguments);
diff --git a/docs/more-pages.md b/docs/more-pages.md
index 38184a2..46e7df8 100644
--- a/docs/more-pages.md
+++ b/docs/more-pages.md
@@ -72,6 +72,16 @@ You can specify `alias` to avoid unnecessary fallback.
!> You can create a `README.md` file in a subdirectory to use it as the landing page for the route.
+## Set Page Titles from Sidebar Selection
+
+A page's `title` tag is generated from the _selected_ sidebar item name. For better SEO, you can customize the title by specifying a string after the filename.
+
+```markdown
+
+* [Home](/)
+* [Guide](guide.md "The greatest guide in the world")
+```
+
## Table of Contents
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
diff --git a/docs/plugins.md b/docs/plugins.md
index ae4e466..3706b89 100644
--- a/docs/plugins.md
+++ b/docs/plugins.md
@@ -40,6 +40,10 @@ By default, the hyperlink on the current page is recognized and the content is s
depth: 2,
hideOtherSidebarContent: false, // whether or not to hide other sidebar content
+
+ // To avoid search index collision
+ // between multiple websites under the same domain
+ namespace: 'website-1',
}
}
@@ -95,7 +99,7 @@ Medium's image zoom. Based on [medium-zoom](https://github.com/francoischalifour
Exclude the special image
```markdown
-
+
```
## Edit on github
@@ -184,6 +188,10 @@ window.$docsify = {
A docsify.js plugin for displaying tabbed content from markdown.
-* [Documentation & Demos](https://jhildenbiddle.github.io/docsify-tabs)
+- [Documentation & Demos](https://jhildenbiddle.github.io/docsify-tabs)
Provided by [@jhildenbiddle](https://github.com/jhildenbiddle/docsify-tabs).
+
+## More plugins
+
+See [awesome-docsify](awesome?id=plugins)
diff --git a/docs/ssr.md b/docs/ssr.md
index 3fa6879..e9c435f 100644
--- a/docs/ssr.md
+++ b/docs/ssr.md
@@ -111,7 +111,7 @@ var readFileSync = require('fs').readFileSync
// init
var renderer = new Renderer({
- template: readFileSync('./docs/index.template.html', 'utf-8').,
+ template: readFileSync('./docs/index.template.html', 'utf-8'),
config: {
name: 'docsify',
repo: 'docsifyjs/docsify'
diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md
index 2f5af37..baa894e 100644
--- a/docs/write-a-plugin.md
+++ b/docs/write-a-plugin.md
@@ -6,41 +6,41 @@ A plugin is simply a function that takes `hook` as an argument. The hook support
```js
window.$docsify = {
- plugins: [
- function (hook, vm) {
- hook.init(function() {
- // Called when the script starts running, only trigger once, no arguments,
- })
+ plugins: [
+ function(hook, vm) {
+ hook.init(function() {
+ // Called when the script starts running, only trigger once, no arguments,
+ });
- hook.beforeEach(function(content) {
- // Invoked each time before parsing the Markdown file.
- // ...
- return content
- })
+ hook.beforeEach(function(content) {
+ // Invoked each time before parsing the Markdown file.
+ // ...
+ return content;
+ });
- hook.afterEach(function(html, next) {
- // Invoked each time after the Markdown file is parsed.
- // beforeEach and afterEach support asynchronous。
- // ...
- // call `next(html)` when task is done.
- next(html)
- })
+ hook.afterEach(function(html, next) {
+ // Invoked each time after the Markdown file is parsed.
+ // beforeEach and afterEach support asynchronous。
+ // ...
+ // call `next(html)` when task is done.
+ next(html);
+ });
- hook.doneEach(function() {
- // Invoked each time after the data is fully loaded, no arguments,
- // ...
- })
+ hook.doneEach(function() {
+ // Invoked each time after the data is fully loaded, no arguments,
+ // ...
+ });
- hook.mounted(function() {
- // Called after initial completion. Only trigger once, no arguments.
- })
+ hook.mounted(function() {
+ // Called after initial completion. Only trigger once, no arguments.
+ });
- hook.ready(function() {
- // Called after initial completion, no arguments.
- })
- }
- ]
-}
+ hook.ready(function() {
+ // Called after initial completion, no arguments.
+ });
+ }
+ ]
+};
```
!> You can get internal methods through `window.Docsify`. Get the current instance through the second argument.
@@ -54,21 +54,21 @@ Add footer component in each pages.
```js
window.$docsify = {
plugins: [
- function (hook) {
+ function(hook) {
var footer = [
'',
''
- ].join('')
+ ].join('');
- hook.afterEach(function (html) {
- return html + footer
- })
+ hook.afterEach(function(html) {
+ return html + footer;
+ });
}
]
-}
+};
```
### Edit Button
@@ -77,17 +77,35 @@ window.$docsify = {
window.$docsify = {
plugins: [
function(hook, vm) {
- hook.beforeEach(function (html) {
- var url = 'https://github.com/docsifyjs/docsify/blob/master/docs' + vm.route.file
- var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
+ hook.beforeEach(function(html) {
+ var url =
+ 'https://github.com/docsifyjs/docsify/blob/master/docs/' +
+ vm.route.file;
+ var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n';
- return editHtml
- + html
- + '\n----\n'
- + 'Last modified {docsify-updated} '
- + editHtml
- })
+ return (
+ editHtml +
+ html +
+ '\n----\n' +
+ 'Last modified {docsify-updated} ' +
+ editHtml
+ );
+ });
}
]
-}
+};
```
+
+## Tips
+
+### Get docsify version
+
+```
+console.log(window.Docsify.version)
+```
+
+Current version: loading
+
+
diff --git a/index.html b/index.html
index f15433b..59e6911 100644
--- a/index.html
+++ b/index.html
@@ -21,48 +21,64 @@
+
+
+
+