Skip to content

Commit eb0a912

Browse files
fix: filtering of families and tags (#804)
* fix: filtering of families and tags * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: dark theme --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7c3970c commit eb0a912

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

doc/source/_static/js/landing_page.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,17 @@ function handleFamilySelection() {
117117
document.querySelectorAll(
118118
'#product-families-list input[type="checkbox"]:checked',
119119
),
120-
).map((checkbox) => checkbox.id.replace("family-", "").toLowerCase());
120+
).map((checkbox) =>
121+
checkbox.id.replace("family-", "").replace("\\ ", "-").toLowerCase(),
122+
);
121123

122124
console.log("Selected families:", selectedFamilies);
123125

124126
const projectCards = document.querySelectorAll(".project-card");
125127

126128
projectCards.forEach((card) => {
127129
const family = card.getAttribute("data-family").toLowerCase();
130+
console.log("Family:", family);
128131
card.style.display =
129132
selectedFamilies.length === 0 || selectedFamilies.includes(family)
130133
? "flex"
@@ -137,7 +140,9 @@ function handleTagSelection() {
137140
document.querySelectorAll(
138141
'#product-tags-list input[type="checkbox"]:checked',
139142
),
140-
).map((checkbox) => checkbox.id.replace("tag-", "").toLowerCase());
143+
).map((checkbox) =>
144+
checkbox.id.replace("tag-", "").replace("\\ ", "-").toLowerCase(),
145+
);
141146

142147
console.log("Selected tags:", selectedTags);
143148

doc/source/index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ it is now a collection of many Python packages for using Ansys products through
2727
{% set family = metadata.get('family', 'other') | lower | replace(' ', '-') %}
2828
{% set tags = metadata.get('tags', 'other') | lower %}
2929

30-
<div class="project-card sd-shadow-sm sd-card-hover" data-family="{{ family }}" data-tags="{{ tags }}">
30+
<div class="project-card sd-card sd-shadow-sm sd-card-hover" data-family="{{ family }}" data-tags="{{ tags }}">
3131
<img class="project-thumbnail" src="{{ metadata['thumbnail'] }}" />
32-
<p class="project-title"> {{ metadata['name'] }} </p>
33-
<p class="project-description"> {{ metadata['description'] }} </p>
32+
<div class="sd-card-body">
33+
<p class="sd-card-title sd-font-weight-bold"> {{ metadata['name'] }} </p>
34+
<p class="sd-card-body-text"> {{ metadata['description'] }} </p>
35+
</div>
3436
</div>
3537

3638
{% endfor %}

0 commit comments

Comments
 (0)