Skip to content

Commit

Permalink
Layout List in a global shortcode. Fixes #131.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuclear-Squid committed Mar 20, 2024
1 parent b66b467 commit 15d5f36
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
20 changes: 1 addition & 19 deletions www/content/dactylo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,7 @@ <h2><span class="key_list"></span><span class="quacks">🦆</span></h2>
<x-keyboard></x-keyboard>
<p style="text-align: right;">
<span style="float: left;">
<select id="layout">
<option disabled>  [en]</option>
<option value="qwerty">Qwerty</option>
<option value="dvorak">Dvorak</option>
<option value="colemak">Colemak</option>
<option value="colemak-dh">Colemak-DH</option>
<option value="workman">Workman</option>
<option value="ISRT">ISRT</option>
<option value="MTGAP">MTGAP</option>
<option value="sturdy">Sturdy</option>
<option disabled>  [fr]</option>
<option value="azerty">Azerty</option>
<option value="lafayette">Lafayette</option>
<option value="ergol" selected>Ergo‑L</option>
<option value="erglace">Erglace</option>
<option value="colemak-french-touch">Colemak French Touch</option>
<option value="bepolar">Bépolar</option>
<option value="bepo">Bépo</option>
</select>
{{< layout-list >}}
<select id="dict">
<option value="fr,french_1k">Français 1k</option>
<option value="fr,french_10k" selected>Français 10k</option>
Expand Down
22 changes: 2 additions & 20 deletions www/content/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,7 @@

<div id="sticky-select">
<form>
<select id="layout">
<option disabled>  [en]</option>
<option value="qwerty">Qwerty</option>
<option value="dvorak">Dvorak</option>
<option value="colemak">Colemak</option>
<option value="colemak-dh">Colemak-DH</option>
<option value="workman">Workman</option>
<option value="ISRT">ISRT</option>
<option value="MTGAP">MTGAP</option>
<option value="sturdy">Sturdy</option>
<option disabled>  [fr]</option>
<option value="azerty">Azerty</option>
<option value="lafayette">Lafayette</option>
<option value="ergol" selected>Ergo‑L</option>
<option value="erglace">Erglace</option>
<option value="colemak-french-touch">Colemak French Touch</option>
<option value="bepolar">Bépolar</option>
<option value="bepo">Bépo</option>
</select>
{{< layout-list >}}
<select id="geometry">
<option value="iso" selected>ISO</option>
<option value="ansi">ANSI</option>
Expand All @@ -51,7 +33,7 @@

<p id="imprecise-data"> <strong>Attention :</strong> cette disposition
ne supporte pas de nombreux caractères du corpus sélectionné.
Les résultats ne sont proposés qu’à titre indicatif. </p>
Les résultats ne sont proposés qu’à titre indicatif. </p>
</div>

<h2>Métriques</h2>
Expand Down
36 changes: 36 additions & 0 deletions www/layouts/shortcodes/layout-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{ $default_layout := "ergol" }}
{{ $layouts := dict
"en" (dict
"qwerty" "Qwerty"
"dvorak" "Dvorak"
"colemak" "Colemak"
"colemak-dh" "Colemak-DH"
"workman" "Workman"
"ISRT" "ISRT"
"MTGAP" "MTGAP"
"sturdy" "Sturdy"
)

"fr" (dict
"azerty" "Azerty"
"lafayette" "Lafayette"
"ergol" "Ergo‑L"
"erglace" "Erglace"
"colemak-french-touch" "Colemak French Touch"
"bepolar" "Bépolar"
"bepo" "Bépo"
)
}}

<select id="layout">
{{ range $language, $layouts_language := $layouts }}
<option disabled>  [{{ $language }}]</option>
{{ range $json_name, $displayed_name := $layouts_language }}
{{ if eq $default_layout $json_name }}
<option value="{{ $json_name }}" selected> {{ $displayed_name }} </option>
{{ else }}
<option value="{{ $json_name }}"> {{ $displayed_name }} </option>
{{ end }}
{{ end }}
{{ end }}
</select>

0 comments on commit 15d5f36

Please sign in to comment.