Keine Explizite Temperatur-Umrechungs-Logik mehr im generischen JavaScript
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
{{ define "main" }}
|
||||
{{ $catData := index hugo.Data .Params.category }}
|
||||
{{ $config := "" }}
|
||||
{{ if eq .Params.engine "linear" }}
|
||||
{{ $config = dict "fromFactor" .Params.from_factor
|
||||
"toFactor" .Params.to_factor | jsonify }}
|
||||
{{ else if eq .Params.engine "intermediate" }}
|
||||
{{ $config = dict "fromUnit" .Params.from_unit
|
||||
"toUnit" .Params.to_unit | jsonify }}
|
||||
{{ $toExpr := index $catData.to_intermediate
|
||||
.Params.from | default "v" }}
|
||||
{{ $fromExpr := index $catData.from_intermediate
|
||||
.Params.to | default "v" }}
|
||||
{{ $config = printf
|
||||
"{ toIntermediate: v => %s, fromIntermediate: v => %s }"
|
||||
$toExpr $fromExpr }}
|
||||
{{ else if eq .Params.engine "runtime" }}
|
||||
{{ $config = dict "fromCurrency" .Params.from
|
||||
"toCurrency" .Params.to | jsonify }}
|
||||
{{ end }}
|
||||
|
||||
{{ $catData := index hugo.Data .Params.category }}
|
||||
{{ $availableUnits := partial "available-units.html"
|
||||
(dict "category" .Params.category "units" $catData.units) }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user