Skip to content

Commit

Permalink
Move new card creation outside of else block (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-rose authored Jun 4, 2024
1 parent 9214820 commit 94aba6a
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions site/_extensions/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,30 +221,31 @@ def build_from_repos(
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_url}" class="gallery-thumbnail" />
<div class="container">
<a href="{cookbook_url}" class="text-decoration-none"><h4 class="display-4 p-0">{cookbook_title}</h4></a>
<p class="card-subtitle">{authors_str}</p>
<p class="my-2">{short_description} </p>
</div>
</div>
{modal_str}
+++
<div class="tagsandbadges">
{tags}
<div>{status_badges}</div>
</div>
:::
"""

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

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

Expand Down

0 comments on commit 94aba6a

Please sign in to comment.