Skip to content

Commit a64cee1

Browse files
committed
feat: add edit button demo
1 parent f943fed commit a64cee1

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

Diff for: dev.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,16 @@
3434
formatUpdated: '{MM}/{DD} {HH}:{mm}',
3535
routerMode: 'history',
3636
plugins: [
37-
function(hook) {
37+
function(hook, vm) {
3838
hook.beforeEach(function (html) {
39-
return html += '\n> Last modified {docsify-updated}'
39+
var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile()
40+
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
41+
42+
return editHtml
43+
+ html
44+
+ '\n----\n'
45+
+ 'Last modified {docsify-updated} '
46+
+ editHtml
4047
})
4148
}
4249
]

Diff for: docs/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@
5151
},
5252
formatUpdated: '{MM}/{DD} {HH}:{mm}',
5353
plugins: [
54-
function(hook) {
54+
function(hook, vm) {
5555
hook.beforeEach(function (html) {
56-
return html += '\n> Last modified {docsify-updated}'
56+
var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile()
57+
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
58+
59+
return editHtml
60+
+ html
61+
+ '\n----\n'
62+
+ 'Last modified {docsify-updated} '
63+
+ editHtml
5764
})
5865
}
5966
]

0 commit comments

Comments
 (0)