Skip to content

Commit b8e6dd5

Browse files
authored
Merge pull request #1200 from maxmind/kevin/toc
Add table of contents to some API pages
2 parents e5eb3d3 + 53ba67a commit b8e6dd5

File tree

6 files changed

+34
-0
lines changed

6 files changed

+34
-0
lines changed

assets/scss/_page.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,26 @@
6363
margin-right: calc(var(--mm-spacing) / 3);
6464
}
6565
}
66+
67+
.page__toc {
68+
background-color: #F8FAFC;
69+
border: 1px solid var(--mm-color-border);
70+
border-radius: var(--mm-border-radius);
71+
padding: calc(var(--mm-spacing) / 2);
72+
73+
ul {
74+
margin: 0;
75+
}
76+
77+
ul ul {
78+
margin-top: calc(var(--mm-spacing) / 8);
79+
}
80+
81+
li {
82+
margin-bottom: calc(var(--mm-spacing) / 8);
83+
}
84+
}
85+
86+
.page__toc__title {
87+
margin-top: 0;
88+
}

content/geoip/docs/web-services/requests.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
draft: false
33
title: GeoIP and GeoLite API Requests
4+
type: "has-toc"
45
---
56

67
## Authorization and Security

content/geoip/docs/web-services/responses.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
draft: false
33
title: GeoIP and GeoLite API Responses
4+
type: "has-toc"
45
---
56

67
## Headers

content/minfraud/api-documentation/requests.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
draft: false
33
title: minFraud API Requests
4+
type: "has-toc"
45
---
56

67
## Authorization and Security

content/minfraud/api-documentation/responses.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
draft: false
33
title: minFraud API Responses
4+
type: "has-toc"
45
---
56

67
## Headers

layouts/partials/page.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
</div>
55
<div class="page__content">
66
<h1 class="page__title">{{ .Title }}</h1>
7+
{{ if eq .Type "has-toc" }}
8+
<div class="page__toc">
9+
<h3 class="page__toc__title">On this page</h3>
10+
{{ .TableOfContents }}
11+
</div>
12+
{{ end }}
13+
714
{{ .Content }}
815

916
{{ if eq .Type "release-note" }}

0 commit comments

Comments
 (0)