Go to Stable Django Doc


Bookmarklets

Post #147

EN

Go to Stable Django Doc

Tuesday, 03 November 2020 09:25:09 by Khodok

1 min read

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.


This post has 0 comments.