Skip to content

Commit

Permalink
Fix missing json object for device uplink element (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjamescompton authored Dec 1, 2023
1 parent 59926a3 commit d17038f
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions website/layouts/devices/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{ $siteUrl := .Site.BaseURL }}

<section class="device-single" >
<section class="device-single">
<div class="grid">
<div class="item-6 item-start-4 item-xs-12 item-start-xs-1">
{{ $image := .Resources.GetMatch (printf "images/%s" .Params.photos.main) }}
Expand All @@ -21,12 +21,13 @@ <h1 class="device-single__title">{{ .Params.name }}</h1>
<div class="item-12">
<div class="device-single__cta">
{{ with (index .Params.resellerURLs 0) }}
<a href="{{ .url }}" class="ttui-btn ttui-btn--primary">Buy Device</a>
<a href="{{ .url }}" class="ttui-btn ttui-btn--primary">Buy Device</a>
{{ end }}
{{with .Params.producturl}}
<a href="{{ . }}" class="ttui-btn ttui-btn--primary">Partner Webpage</a>
<a href="{{ . }}" class="ttui-btn ttui-btn--primary">Partner Webpage</a>
{{ end }}
<a href="https://thethingsindustries.com/contact/?message=Hi%2C%0D%0A%0D%0AI+found+{{.Params.name}}+on+the+LoRaWAN+device+repository+and+I%27m+interested+in+contacting+{{.Params.Vendor.Name}}." class="ttui-btn ttui-btn--primary" id="partner-toggle">Contact Partner</a>
<a href="https://thethingsindustries.com/contact/?message=Hi%2C%0D%0A%0D%0AI+found+{{.Params.name}}+on+the+LoRaWAN+device+repository+and+I%27m+interested+in+contacting+{{.Params.Vendor.Name}}."
class="ttui-btn ttui-btn--primary" id="partner-toggle">Contact Partner</a>
</div>
</div>
<div class="item-12">
Expand All @@ -37,20 +38,24 @@ <h3>Specification</h3>
</div>
<div class="item-6 item-xs-12">
<ul>
{{with .Params.sensors}} <li><b>Sensors:</b> {{ range . }} <a href="{{ $siteUrl }}/tags/{{ lower . | replaceRE ` ` `-` }}">{{ . }}</a> {{ end }}</li>{{ end }}
{{with .Params.ipcode}}<li><b>Enclosure:</b> <a href="{{ $siteUrl }}/tags/{{ lower . }}">{{ . }}</a></li>{{ end }}
{{with .Params.sensors}} <li><b>Sensors:</b> {{ range . }} <a
href="{{ $siteUrl }}/tags/{{ lower . | replaceRE ` ` `-` }}">{{ . }}</a> {{ end }}</li>{{ end }}
{{with .Params.ipcode}}<li><b>Enclosure:</b> <a href="{{ $siteUrl }}/tags/{{ lower . }}">{{ . }}</a></li>
{{ end }}
{{with .Params.dimensions}}
<li>
<b>Dimensions:</b> {{ .length }} x {{ .width }} x {{ .height }} mm
</li>{{ end }}
<li>
<b>Dimensions:</b> {{ .length }} x {{ .width }} x {{ .height }} mm
</li>{{ end }}
{{with .Params.dimensions.diameter}}<li><b>Diameter:</b> {{ . }}</li>{{ end }}
{{with .Params.operatingconditions.temperature}}<li><b>Temperature:</b> {{ .min }}&#176;C to {{ .max }}&#176;C</li>{{ end }}
{{with .Params.operatingconditions.temperature}}<li><b>Temperature:</b> {{ .min }}&#176;C to {{ .max
}}&#176;C</li>{{ end }}
</ul>
</div>
<div class="item-6 item-xs-12">
<ul>
{{with .Params.weight}}<li><b>Weight:</b> {{ . }} grams</li>{{ end }}
{{with .Params.codecs}}<li><b>Frequency plans: </b>{{ range $key, $value := . }}<a href="{{ $siteUrl }}/tags/{{ lower $key }}">{{ $key }}</a> {{ end }}</li>{{ end }}
{{with .Params.codecs}}<li><b>Frequency plans: </b>{{ range $key, $value := . }}<a
href="{{ $siteUrl }}/tags/{{ lower $key }}">{{ $key }}</a> {{ end }}</li>{{ end }}
</ul>
</div>
</div>
Expand All @@ -62,6 +67,12 @@ <h3>Specification</h3>
</div>
</section>

<script>
var config = {
device: JSON.parse("{{ .Params | jsonify }}")
}
</script>

<script src="{{- (index .Site.Data.manifest `device_single.js`) | relURL -}}"></script>

{{ end }}

0 comments on commit d17038f

Please sign in to comment.