Skip to content

Commit

Permalink
Use <article> element for example cards
Browse files Browse the repository at this point in the history
  • Loading branch information
coliff committed Oct 22, 2024
1 parent 30e0152 commit 50f58ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions site/layouts/partials/examples/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2 id="{{ $entry.category | urlize }}">{{ $entry.category }}</h2>
{{- $len := len $entry.examples -}}
{{ if (eq $i 0) }}<div class="row">{{ end }}
{{ if $entry.external -}}
<div class="col-md-6 col-lg-4 mb-3 d-flex gap-3">
<article class="col-md-6 col-lg-4 mb-3 d-flex gap-3">
<svg class="bi fs-5 flex-shrink-0 mt-1" aria-hidden="true"><use xlink:href="#box-seam"></use></svg>
<div>
<h3 class="h5 mb-1">
Expand All @@ -32,9 +32,9 @@ <h3 class="h5 mb-1">
</a>
</p>
</div>
</div>
</article>
{{ else -}}
<div class="col-sm-6 col-md-3 mb-3">
<article class="col-sm-6 col-md-3 mb-3">
{{- $exampleNameUrlized := $example.name | urlize -}}
{{- $exampleUrl := urls.JoinPath "/docs" $.Site.Params.docs_version "/examples" $exampleNameUrlized "/" }}
<a class="d-block link-offset-1" href="{{ $exampleUrl }}"{{ if in $example.name "RTL" }} hreflang="ar"{{ end }}>
Expand All @@ -55,7 +55,7 @@ <h3 class="h5 mb-1">
</h3>
</a>
<p class="text-body-secondary">{{ $example.description }}</p>
</div>
</article>
{{- end }}
{{ if (eq (add $i 1) $len) }}</div>{{ end -}}
{{ end -}}
Expand Down

0 comments on commit 50f58ce

Please sign in to comment.