mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
update GH edit path to develop
branch (#14437)
This commit is contained in:
parent
4fa48a6eb1
commit
83fe3d4011
16
docs/_static/js/initialize.js
vendored
16
docs/_static/js/initialize.js
vendored
@ -143,6 +143,19 @@ const updateActiveNavLink = () => {
|
||||
|
||||
document.addEventListener("locationchange", updateActiveNavLink);
|
||||
|
||||
function updateGitHubEditPath() {
|
||||
// Replaces the version number in the GitHub edit path with "develop"
|
||||
const gitHubEditAnchor = document.querySelector(".wy-breadcrumbs-aside > a");
|
||||
const url = new URL(gitHubEditAnchor.href);
|
||||
const split = url.pathname.split("/");
|
||||
const versionIndex = split.indexOf("blob") + 1;
|
||||
split[versionIndex] = "develop";
|
||||
url.pathname = split.join("/");
|
||||
gitHubEditAnchor.setAttribute("href", url.toString());
|
||||
gitHubEditAnchor.setAttribute("target", "_blank");
|
||||
gitHubEditAnchor.setAttribute("rel", "noopener noreferrer");
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
// Preload fonts
|
||||
const fonts = [
|
||||
@ -214,6 +227,9 @@ function initialize() {
|
||||
|
||||
// Update active nav link
|
||||
updateActiveNavLink();
|
||||
|
||||
// Update GitHub edit path to direct to `develop` branch
|
||||
updateGitHubEditPath();
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", initialize);
|
||||
|
Loading…
Reference in New Issue
Block a user