Skip to content

Commit

Permalink
添加从 github 编辑
Browse files Browse the repository at this point in the history
  • Loading branch information
ripperhe committed Jun 23, 2021
1 parent f7e6f71 commit 5128885
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,21 @@
placeholder: '搜索',
noData: '找不到结果',
},

// plugins: [
// // Edit On Github
// function (hook, vm) {
// hook.beforeEach(function (html) {
// var url = 'https://github.com/ripperhe/docsify-template/blob/master/' + vm.route.file
// var editHtml = '[:memo: Edit Document](' + url + ')\n\n'
// return editHtml
// + html
// + '\n\n----\n\n'
// // + '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
// })
// },
// ]
plugins: [
// Edit On Github
function (hook, vm) {
hook.beforeEach(function (html) {
var url = 'https://github.com/ripperhe/Bob/blob/master/docs/' + vm.route.file
if (vm.route.file === 'https://cdn.jsdelivr.net/gh/ripperhe/Bob@master/README.md') {
url = 'https://github.com/ripperhe/Bob/blob/master/README.md'
}
var editHtml = '[:memo: 在 Github 上编辑](' + url + ')\n\n'
return editHtml
+ html
+ '\n\n----\n\n'
})
},
]
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
Expand Down

0 comments on commit 5128885

Please sign in to comment.