This commit is contained in:
16
node_modules/vitepress/dist/client/theme-default/composables/edit-link.js
generated
vendored
Normal file
16
node_modules/vitepress/dist/client/theme-default/composables/edit-link.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { computed } from 'vue';
|
||||
import { useData } from './data';
|
||||
export function useEditLink() {
|
||||
const { theme, page } = useData();
|
||||
return computed(() => {
|
||||
const { text = 'Edit this page', pattern = '' } = theme.value.editLink || {};
|
||||
let url;
|
||||
if (typeof pattern === 'function') {
|
||||
url = pattern(page.value);
|
||||
}
|
||||
else {
|
||||
url = pattern.replace(/:path/g, page.value.filePath);
|
||||
}
|
||||
return { url, text };
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user