Go to Stable Django Doc

Post #147 written by Khodok in Bookmarklets

Content
JavaScript
1
2
3
4
5
6
7
8
9
/// Indented code
var url = new URL(location),
    value = url.pathname.trimStart(5),
    version = value.split("/")[2],
    lang = value.split("/")[1],
    next = value.replace([lang, version].join("/") + "/", ""),
    hash = url.hash,
    version = "stable";
location.assign("https://docs.djangoproject.com/en/" + version + next + hash);
JavaScript
1
2
/// Bookmarklet
javascript:var url=new URL(location),value=url.pathname.trimStart(5),version=value.split("/")[2],lang=value.split("/")[1],next=value.replace([lang,version].join("/")+"/",""),hash=url.hash,version="stable";location.assign("https://docs.djangoproject.com/en/"+version+next+hash);

note that if the page you’re at doesn’t exist in the latest stable version you’ll get redirected to a 404, if it happens, use the version change feature on Django’s documentation

Comments

Please Log in to leave a comment.

No comments yet.