Skip to content

Commit d859419

Browse files
authored
Fix duplicate gallery cards (ProjectPythia#434)
1 parent 153822a commit d859419

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

portal/_extensions/gallery_generator.py

+18-17
Original file line numberDiff line numberDiff line change
@@ -123,27 +123,28 @@ def build_from_items(items, filename, title='Gallery', subtitle=None, subtext=No
123123
modal_str = '\n'.join([m.lstrip() for m in modal_str.split('\n')])
124124
else:
125125
modal_str = ''
126-
new_card = f"""\
127-
:::{{grid-item-card}}
128-
:shadow: md
129-
:class-footer: card-footer
130-
<div class="d-flex gallery-card">
131-
<img src="{thumbnail}" class="gallery-thumbnail" />
132-
<div class="container">
133-
<a href="{item["url"]}" class="text-decoration-none"><h4 class="display-4 p-0">{item["title"]}</h4></a>
134-
<p class="card-subtitle">{authors_str}<br/>{affiliations_str}</p>
135-
<p class="my-2">{short_description} </p>
136-
</div>
137-
</div>
138-
{modal_str}
139126

140-
+++
127+
new_card = f"""\
128+
:::{{grid-item-card}}
129+
:shadow: md
130+
:class-footer: card-footer
131+
<div class="d-flex gallery-card">
132+
<img src="{thumbnail}" class="gallery-thumbnail" />
133+
<div class="container">
134+
<a href="{item["url"]}" class="text-decoration-none"><h4 class="display-4 p-0">{item["title"]}</h4></a>
135+
<p class="card-subtitle">{authors_str}<br/>{affiliations_str}</p>
136+
<p class="my-2">{short_description} </p>
137+
</div>
138+
</div>
139+
{modal_str}
141140
142-
{tags}
141+
+++
143142
144-
:::
143+
{tags}
145144
146-
"""
145+
:::
146+
147+
"""
147148

148149
grid_body.append('\n'.join([m.lstrip() for m in new_card.split('\n')]))
149150

0 commit comments

Comments
 (0)