docs-v2/layouts/_default/page-list.json

81 lines
3.3 KiB
JSON

{{- $productPathData := findRE "[^/]+.*?" .RelPermalink -}}
{{- $product := index $productPathData 0 -}}
{{- $version := index $productPathData 1 -}}
{{- $menuKey := print $product "_" (replaceRE `-` "_" $version) -}}
{{- $menu := index .Site.Menus $menuKey -}}
[
{{ range $index, $entry := $menu }}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{- range $index, $entry := .Children -}}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{- range $index, $entry := .Children -}}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{- range $index, $entry := .Children -}}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{- range $index, $entry := .Children -}}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{- range $index, $entry := .Children -}}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{- range $index, $entry := .Children -}}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{- range $index, $entry := .Children -}}
{{- if $index -}},{{- end }}
{
"name": {{ .Name | jsonify }},
"url": {{ absURL (cond (isset .Params "url") .Params.url .URL) | jsonify }},
"children": [
{{ range .Children }}
{{ end }}
]
}
{{ end }}
]
}
{{ end }}
]
}
{{ end }}
]
}
{{ end }}
]
}
{{ end }}
]
}
{{ end }}
]
}
{{ end }}
]
}
{{ end }}
]