Skip to content

Commit

Permalink
Merge pull request #1200 from maxmind/kevin/toc
Browse files Browse the repository at this point in the history
Add table of contents to some API pages
  • Loading branch information
kevcenteno authored Oct 7, 2024
2 parents e5eb3d3 + 53ba67a commit b8e6dd5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
23 changes: 23 additions & 0 deletions assets/scss/_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,26 @@
margin-right: calc(var(--mm-spacing) / 3);
}
}

.page__toc {
background-color: #F8FAFC;
border: 1px solid var(--mm-color-border);
border-radius: var(--mm-border-radius);
padding: calc(var(--mm-spacing) / 2);

ul {
margin: 0;
}

ul ul {
margin-top: calc(var(--mm-spacing) / 8);
}

li {
margin-bottom: calc(var(--mm-spacing) / 8);
}
}

.page__toc__title {
margin-top: 0;
}
1 change: 1 addition & 0 deletions content/geoip/docs/web-services/requests.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
draft: false
title: GeoIP and GeoLite API Requests
type: "has-toc"
---

## Authorization and Security
Expand Down
1 change: 1 addition & 0 deletions content/geoip/docs/web-services/responses.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
draft: false
title: GeoIP and GeoLite API Responses
type: "has-toc"
---

## Headers
Expand Down
1 change: 1 addition & 0 deletions content/minfraud/api-documentation/requests.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
draft: false
title: minFraud API Requests
type: "has-toc"
---

## Authorization and Security
Expand Down
1 change: 1 addition & 0 deletions content/minfraud/api-documentation/responses.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
draft: false
title: minFraud API Responses
type: "has-toc"
---

## Headers
Expand Down
7 changes: 7 additions & 0 deletions layouts/partials/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
</div>
<div class="page__content">
<h1 class="page__title">{{ .Title }}</h1>
{{ if eq .Type "has-toc" }}
<div class="page__toc">
<h3 class="page__toc__title">On this page</h3>
{{ .TableOfContents }}
</div>
{{ end }}

{{ .Content }}

{{ if eq .Type "release-note" }}
Expand Down

0 comments on commit b8e6dd5

Please sign in to comment.