Einheiten Reihenfolge wie in den JSON-Daten angegeben
This commit is contained in:
@@ -82,11 +82,12 @@
|
||||
@change="navigateWithValue(
|
||||
$event.target.value)"
|
||||
class="select mt-1 block w-full">
|
||||
{{ range $unit, $unitData := $availableUnits }}
|
||||
{{ if ne $unit $.Params.to }}
|
||||
{{ range $catData.unitOrder }}
|
||||
{{ $unitData := index $availableUnits . }}
|
||||
{{ if and $unitData (ne . $.Params.to) }}
|
||||
<option
|
||||
value="/{{ $unit }}-in-{{ $.Params.to }}/"
|
||||
{{ if eq $unit
|
||||
value="/{{ . }}-in-{{ $.Params.to }}/"
|
||||
{{ if eq .
|
||||
$.Params.from }}selected{{ end }}>
|
||||
{{ $unitData.name }}
|
||||
</option>
|
||||
@@ -127,11 +128,12 @@
|
||||
@change="navigateWithValue(
|
||||
$event.target.value)"
|
||||
class="select mt-1 block w-full">
|
||||
{{ range $unit, $unitData := $availableUnits }}
|
||||
{{ if ne $unit $.Params.from }}
|
||||
{{ range $catData.unitOrder }}
|
||||
{{ $unitData := index $availableUnits . }}
|
||||
{{ if and $unitData (ne . $.Params.from) }}
|
||||
<option
|
||||
value="/{{ $.Params.from }}-in-{{ $unit }}/"
|
||||
{{ if eq $unit
|
||||
value="/{{ $.Params.from }}-in-{{ . }}/"
|
||||
{{ if eq .
|
||||
$.Params.to }}selected{{ end }}>
|
||||
{{ $unitData.name }}
|
||||
</option>
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{- $category := .category }}{{ $units := .units }}{{ $available := partial "available-units.html" (dict "category" $category "units" $units) }}{{ $url := "" }}{{ if gt (len $available) 0 }}{{ $firstUnit := "" }}{{ $secondUnit := "" }}{{ range $u, $_ := $available }}{{ if eq $firstUnit "" }}{{ $firstUnit = $u }}{{ else if eq $secondUnit "" }}{{ $secondUnit = $u }}{{ end }}{{ end }}{{ $url = printf "/%s-in-%s/" $firstUnit $secondUnit }}{{ end }}{{- $url -}}
|
||||
{{- $category := .category }}{{ $units := .units }}{{ $available := partial "available-units.html" (dict "category" $category "units" $units) }}{{ $url := "" }}{{ if gt (len $available) 0 }}{{ $catData := index hugo.Data $category }}{{ $firstUnit := "" }}{{ $secondUnit := "" }}{{ range $catData.unitOrder }}{{ $unitData := index $available . }}{{ if $unitData }}{{ if eq $firstUnit "" }}{{ $firstUnit = . }}{{ else if eq $secondUnit "" }}{{ $secondUnit = . }}{{ end }}{{ end }}{{ end }}{{ $url = printf "/%s-in-%s/" $firstUnit $secondUnit }}{{ end }}{{- $url -}}
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
<div><b>{{ $data.name }}</b></div>
|
||||
<ul class="pl-1 text-xs">
|
||||
{{ $count := 0 }}
|
||||
{{ range $unitSlug, $unitData := $units }}
|
||||
{{ if lt $count 12 }}
|
||||
{{ range $data.unitOrder }}
|
||||
{{ $unitSlug := . }}
|
||||
{{ $unitData := index $units $unitSlug }}
|
||||
{{ if and $unitData (lt $count 12) }}
|
||||
{{ $toSlug := "" }}
|
||||
{{ range $u, $ud := $units }}
|
||||
{{ if and (ne $u $unitSlug) (eq $toSlug "") }}
|
||||
{{ $toSlug = $u }}
|
||||
{{ range $data.unitOrder }}
|
||||
{{ if and (ne . $unitSlug) (eq $toSlug "") }}
|
||||
{{ $toSlug = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $url := printf "/%s-in-%s/" $unitSlug $toSlug }}
|
||||
|
||||
Reference in New Issue
Block a user