diff --git a/content/influxdb/cloud-dedicated/pages.md b/content/influxdb/cloud-dedicated/pages.md new file mode 100644 index 000000000..3581f182a --- /dev/null +++ b/content/influxdb/cloud-dedicated/pages.md @@ -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. diff --git a/content/influxdb/cloud-serverless/pages.md b/content/influxdb/cloud-serverless/pages.md new file mode 100644 index 000000000..3581f182a --- /dev/null +++ b/content/influxdb/cloud-serverless/pages.md @@ -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. diff --git a/content/influxdb/clustered/pages.md b/content/influxdb/clustered/pages.md new file mode 100644 index 000000000..3581f182a --- /dev/null +++ b/content/influxdb/clustered/pages.md @@ -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. diff --git a/hugo.staging.toml b/hugo.staging.toml index 236317a19..432b438fa 100644 --- a/hugo.staging.toml +++ b/hugo.staging.toml @@ -46,3 +46,8 @@ smartDashes = false [privacy.youtube] disable = false privacyEnhanced = true + +[outputFormats.json] + mediaType = "application/json" + baseName = "pages" + isPlainText = true diff --git a/hugo.toml b/hugo.toml index 70d0339b2..1abf7d2c4 100644 --- a/hugo.toml +++ b/hugo.toml @@ -42,3 +42,8 @@ smartDashes = false [privacy.youtube] disable = false privacyEnhanced = true + +[outputFormats.json] + mediaType = "application/json" + baseName = "pages" + isPlainText = true diff --git a/layouts/_default/page-list.json b/layouts/_default/page-list.json new file mode 100644 index 000000000..507009897 --- /dev/null +++ b/layouts/_default/page-list.json @@ -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 }} +] \ No newline at end of file diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml index a7ce78de8..8a54dc692 100644 --- a/layouts/sitemap.xml +++ b/layouts/sitemap.xml @@ -1,21 +1,23 @@ {{ range .Data.Pages }} - - {{ .Permalink }}{{ if not .Lastmod.IsZero }} - {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} - {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} - {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} - {{ end }} - {{ end }} - + {{ if not .Params.omit_from_sitemap }} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{ end }} {{ end }}