Skip to content

Commit

Permalink
Introduce indirection in partial
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Nov 8, 2024
1 parent c7842a1 commit 2275ef2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
Empty file.
30 changes: 1 addition & 29 deletions common-theme/layouts/partials/map.html
Original file line number Diff line number Diff line change
@@ -1,29 +1 @@
{{ with .Params.map }}
<div class="c-map">
<h1 class="e-heading c-map__start is-none--lt-container">👉🏾</h1>
{{ range $i, $currentMapSectionName := . }}
{{ $currentMapSectionModules := index site.Menus $currentMapSectionName }}
<section class="c-map__block">
<h2 class="e-heading c-map__title">
📍{{ $i }}:
{{ $currentMapSectionName }}
</h2>
<ol class="c-map__timeline">
{{/* Check if a menu for the current map section exists */}}
{{ if $currentMapSectionModules }}
{{/* Range over the items in the menu */}}
{{ range $iterator, $module := $currentMapSectionModules }}
<li
class="c-map__stop"
style="--layer:{{ sub (len $currentMapSectionModules) (add $iterator 1) }}">
{{ partial "card.html" $module }}
</li>
{{ end }}
{{ else }}
<li>No items found for {{ $currentMapSectionName }}</li>
{{ end }}
</ol>
</section>
{{ end }}
</div>
{{ end }}
{{ partial "map-common.html" . }}

0 comments on commit 2275ef2

Please sign in to comment.