Skip to content

Commit 970b8a2

Browse files
committed
html: ensure that attribution is always shown
1 parent ef7c6de commit 970b8a2

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

html/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ <h1 class="site-title">❯ curl {{ .Host }}</h1>
4141

4242
<!-- Details -->
4343
<section class="section" id="details">
44-
<div class="details-grid{{ if not .Latitude }} single-column{{ end }}">
44+
<div class="details-grid">
4545
<div>
46-
<h2>Information about your IP address</h2>
46+
<h2>Additional information</h2>
4747
<table class="info-table">
4848
<tbody>
4949
<tr>
@@ -141,9 +141,9 @@ <h2>Information about your IP address</h2>
141141
</tbody>
142142
</table>
143143
</div>
144-
{{ if .Latitude }}
145144
<div>
146-
<h2>Your location</h2>
145+
<h2>Location</h2>
146+
{{ if .Latitude }}
147147
<div class="map-wrapper">
148148
<iframe
149149
width="100%"
@@ -153,14 +153,16 @@ <h2>Your location</h2>
153153
src="https://www.openstreetmap.org/export/embed.html?bbox={{ .BoxLonLeft }}%2C{{ .BoxLatBottom }}%2C{{ .BoxLonRight }}%2C{{ .BoxLatTop }}&amp;layer=mapnik&amp;marker={{ .Latitude }}%2C{{ .Longitude }}"
154154
></iframe>
155155
</div>
156+
{{ else }}
157+
<p><em>No coordinates available for this IP address.</em></p>
158+
{{ end }}
156159
{{ if .Country }}
157160
<p class="attribution">
158-
Approximate location based on IP address.
161+
{{ if .Latitude }}Approximate location based on IP address.{{ end }}
159162
IP geolocation data is provided by <a href="https://www.maxmind.com">MaxMind GeoLite2.</a>
160163
</p>
161164
{{ end }}
162165
</div>
163-
{{ end }}
164166
</div>
165167
</section>
166168

0 commit comments

Comments
 (0)