Skip to content

Commit

Permalink
Fix duplicate gallery cards (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-rose authored Jun 4, 2024
1 parent 153822a commit d859419
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions portal/_extensions/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,28 @@ def build_from_items(items, filename, title='Gallery', subtitle=None, subtext=No
modal_str = '\n'.join([m.lstrip() for m in modal_str.split('\n')])
else:
modal_str = ''
new_card = f"""\
:::{{grid-item-card}}
:shadow: md
:class-footer: card-footer
<div class="d-flex gallery-card">
<img src="{thumbnail}" class="gallery-thumbnail" />
<div class="container">
<a href="{item["url"]}" class="text-decoration-none"><h4 class="display-4 p-0">{item["title"]}</h4></a>
<p class="card-subtitle">{authors_str}<br/>{affiliations_str}</p>
<p class="my-2">{short_description} </p>
</div>
</div>
{modal_str}

+++
new_card = f"""\
:::{{grid-item-card}}
:shadow: md
:class-footer: card-footer
<div class="d-flex gallery-card">
<img src="{thumbnail}" class="gallery-thumbnail" />
<div class="container">
<a href="{item["url"]}" class="text-decoration-none"><h4 class="display-4 p-0">{item["title"]}</h4></a>
<p class="card-subtitle">{authors_str}<br/>{affiliations_str}</p>
<p class="my-2">{short_description} </p>
</div>
</div>
{modal_str}
{tags}
+++
:::
{tags}
"""
:::
"""

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

Expand Down

0 comments on commit d859419

Please sign in to comment.