wiki/assets/edit.js
2021-04-03 15:55:30 +02:00

11 lines
316 B
JavaScript

(() => {
let editLink = document.getElementById("git-repository-button").parentElement
const relativeFile = location
.pathname
.split("/")
.slice(-path_to_root.split("/").length)
.join("/")
.replace(/\.html$/, ".md")
editLink.href = editLink.href + "/edit/master/src/" + relativeFile
})();