-
Notifications
You must be signed in to change notification settings - Fork 19
/
redirects.dhall
89 lines (79 loc) · 2.64 KB
/
redirects.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
let concatMap =
https://prelude.dhall-lang.org/List/concatMap
sha256:3b2167061d11fda1e4f6de0522cbe83e0d5ac4ef5ddf6bb0b2064470c5d3fb64
let Entry = { from : Text, to : Text, status : Natural, force : Bool }
let Conf = { oldPrefix : Text, newPrefix : Text }
let Mapping = { old : Text, new : Text }
let mkEntry =
\(c : Conf) ->
\(e : Mapping) ->
[ { from = "/docs/${c.oldPrefix}/${e.old}/"
, to = "https://doc.biscuitsec.org/${c.newPrefix}/${e.new}.html"
, status = 301
, force = True
}
, { from = "docs/${c.oldPrefix}/${e.old}/index.html"
, to = "https://doc.biscuitsec.org/${c.newPrefix}/${e.new}.html"
, status = 301
, force = True
}
]
let mkSectionEntry =
\(e : Mapping) ->
[ { from = "/docs/${e.old}"
, to = "https://doc.biscuitsec.org/${e.new}.html"
, status = 301
, force = True
}
, { from = "docs/${e.old}/index.html"
, to = "https://doc.biscuitsec.org/${e.new}.html"
, status = 301
, force = True
}
]
let gettingStarted =
concatMap
Mapping
Entry
( mkEntry
{ oldPrefix = "getting-started", newPrefix = "getting-started" }
)
[ { old = "introduction", new = "introduction" }
, { old = "token", new = "introduction" }
, { old = "my-first-biscuit", new = "my-first-biscuit" }
, { old = "policies", new = "authorization-policies" }
, { old = "datalog", new = "authorization-policies" }
]
let usage =
concatMap
Mapping
Entry
(mkEntry { oldPrefix = "Usage", newPrefix = "usage" })
[ { old = "c", new = "c" }
, { old = "go", new = "go" }
, { old = "node", new = "nodejs" }
, { old = "cli", new = "command-line" }
, { old = "haskell", new = "haskell" }
, { old = "java", new = "java" }
, { old = "rust", new = "rust" }
]
let recipes =
concatMap
Mapping
Entry
(mkEntry { oldPrefix = "guides", newPrefix = "recipes" })
[ { old = "common-patterns", new = "common-patterns" }
, { old = "interop", new = "interoperability-reusability" }
, { old = "rbac", new = "role-based-access-control" }
]
let reference =
concatMap
Text
Entry
( \(t : Text) ->
mkEntry
{ oldPrefix = "reference", newPrefix = "reference" }
{ old = t, new = t }
)
[ "cryptography", "datalog" ]
in { redirects = gettingStarted # usage # recipes # reference }