Skip to content

Commit

Permalink
Introduce a human-readable sitemap to the documentation (#1403)
Browse files Browse the repository at this point in the history
* doc: Update reference

* doc: Add sitemap
  • Loading branch information
KrishnaIyer authored Feb 3, 2025
1 parent a790856 commit 7c68b2d
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 6 deletions.
7 changes: 6 additions & 1 deletion doc/config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ pygmentsUseClasses = true
[[menu.about_us]]
name = "The Things Industries"
url = "https://www.thethingsindustries.com"
weight = 2
weight = 3

[[menu.buttons]]
name = "Get The Things Stack"
url = "https://www.thethingsindustries.com/stack/plans/"
weight = 1
[menu.buttons.params]
target = "_blank"

[[menu.sitemap]]
name = "View our Sitemap"
url = "https://www.thethingsindustries.com/docs/sitemap/"
weight = 2
2 changes: 1 addition & 1 deletion doc/content/concepts/features/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To use the CLI, you need to complete three steps:

If you need help with any CLI command, use the `--help` flag to get a list of subcommands, flags and their description and aliases.

For a complete list of CLI commands, see the [CLI reference]({{< ref "/concepts/features/cli" >}}).
For a complete list of CLI commands, see the [CLI reference]({{< ref "/concepts/features/cli/reference" >}}).

For troubleshooting common CLI errors, see the [Troubleshooting CLI]({{< relref "troubleshooting" >}}) section.

Expand Down
7 changes: 7 additions & 0 deletions doc/content/sitemap/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Sitemap"
description: ""
weight: 10
---

{{< sitemap >}}
4 changes: 4 additions & 0 deletions doc/content/ttn-lw-cli/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Command-line Interface Reference"
description: ""
---
15 changes: 11 additions & 4 deletions doc/themes/the-things-stack/layouts/partials/footer/footer.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<footer class="footer">
<div class="container">
<div class="columns">
<nav class="column is-one-third">
<h3 class="title is-6">The Things Stack</h3>
<nav class="column is-one-fourth">
<h3 class="title is-6">Sections</h3>
{{- $currentPage := . -}}
{{- range .Site.Menus.main }}
<p><a class="{{ if $currentPage.IsMenuCurrent "main" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></p>
{{- end }}
</nav>
<nav class="column is-one-fourth">
<h3 class="title is-6">Sitemap</h3>
{{- $currentPage := . -}}
{{- range .Site.Menus.sitemap }}
<p><a class="{{ if $currentPage.IsMenuCurrent "sitemap" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></p>
{{- end }}
</nav>
{{- if .Site.Menus.contributing }}
<nav class="column is-one-third">
<nav class="column is-one-fourth">
<h3 class="title is-6">Contributing</h3>
{{- $currentPage := . -}}
{{- range .Site.Menus.contributing }}
Expand All @@ -18,7 +25,7 @@ <h3 class="title is-6">Contributing</h3>
</nav>
{{ end -}}
{{- if .Site.Menus.about_us }}
<nav class="column is-one-third">
<nav class="column is-one-fourth">
<h3 class="title is-6">About Us</h3>
{{- $currentPage := . -}}
{{- range .Site.Menus.about_us }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ if .Pages }}
<ul>
{{ range .Pages }}
{{ partial "sitemap-recursion.html" . }}
{{ end }}
</ul>
{{ end }}
</li>
19 changes: 19 additions & 0 deletions doc/themes/the-things-stack/layouts/shortcodes/sitemap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Site.Title }} - Sitemap</title>
</head>
<body>
<div class="sitemap-container">
<ul>
{{ range .Site.Sections }}
{{ if ne .Title "Sitemap" }}
{{ partial "sitemap-recursion.html" . }}
{{ end }}
{{ end }}
</ul>
</div>
</body>
</html>

0 comments on commit 7c68b2d

Please sign in to comment.