feat: add Wikipedia shortcut to toggle simple version of current article
Adds shortcut `<leader>s` which toggles between normal articles and their "simple" counterparts. For more information about Simple Wikipedia, see https://simple.wikipedia.org/wiki/Wikipedia:Simple_English_Wikipedia
This commit is contained in:
parent
cb60c972c6
commit
850fad820a
14
conf.js
14
conf.js
|
@ -302,6 +302,20 @@ mapsitekeys("dribbble.com", [
|
|||
["z", "Zoom shot", Hint(".single-img picture, .detail-shot img")],
|
||||
])
|
||||
|
||||
const wpToggleSimple = () => {
|
||||
window.location.hostname = window.location.hostname.split(".")
|
||||
.map((s, i) => {
|
||||
if (i === 0) {
|
||||
return s === "simple" ? "" : "simple"
|
||||
}
|
||||
return s
|
||||
}).filter(s => s !== "").join(".")
|
||||
}
|
||||
|
||||
mapsitekeys("wikipedia.org", [
|
||||
["s", "Toggle simple version of current article", wpToggleSimple],
|
||||
])
|
||||
|
||||
// ---- Search & completion ----//
|
||||
// Search leader
|
||||
const sl = "a"
|
||||
|
|
Loading…
Reference in New Issue