add JSON page lists for use in the v3 UI (#5363)
parent
7520bccd29
commit
259e8e67b4
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
layout: page-list
|
||||
outputs: [json]
|
||||
omit_from_sitemap: true
|
||||
---
|
||||
|
||||
This file is used to generate a JSON file containing the navigation structure
|
||||
for this product. The InfluxDB v3 UI retrieves this JSON to build documentation
|
||||
links in the UI.
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
layout: page-list
|
||||
outputs: [json]
|
||||
omit_from_sitemap: true
|
||||
---
|
||||
|
||||
This file is used to generate a JSON file containing the navigation structure
|
||||
for this product. The InfluxDB v3 UI retrieves this JSON to build documentation
|
||||
links in the UI.
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
layout: page-list
|
||||
outputs: [json]
|
||||
omit_from_sitemap: true
|
||||
---
|
||||
|
||||
This file is used to generate a JSON file containing the navigation structure
|
||||
for this product. The InfluxDB v3 UI retrieves this JSON to build documentation
|
||||
links in the UI.
|
|
@ -46,3 +46,8 @@ smartDashes = false
|
|||
[privacy.youtube]
|
||||
disable = false
|
||||
privacyEnhanced = true
|
||||
|
||||
[outputFormats.json]
|
||||
mediaType = "application/json"
|
||||
baseName = "pages"
|
||||
isPlainText = true
|
||||
|
|
|
@ -42,3 +42,8 @@ smartDashes = false
|
|||
[privacy.youtube]
|
||||
disable = false
|
||||
privacyEnhanced = true
|
||||
|
||||
[outputFormats.json]
|
||||
mediaType = "application/json"
|
||||
baseName = "pages"
|
||||
isPlainText = true
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
{{- $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 }}
|
||||
]
|
|
@ -1,21 +1,23 @@
|
|||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{ range .Data.Pages }}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
{{ if not .Params.omit_from_sitemap }}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</urlset>
|
||||
|
|
Loading…
Reference in New Issue