summaryrefslogtreecommitdiffstats
path: root/scripts/subpages.jq
blob: 4850703f5efb168c4f10b49c4de611f015699eea (plain) (blame)
1
2
3
4
5
6
7
8
[
    .[]
        | . as $page
        | (.namespace | ltrimstr($namespace + "/") | split("/") | (.[] |= ["pages",.]) | flatten) as $path
        | null
        | setpath($path; $page)
]
    | reduce .[] as $item ({}; . * $item)