Skip to content

Feature Request: Closed Shortcode for card/feature-card #782

@KStocky

Description

@KStocky

Feature Description

I would like the ability to create cards (both feature-card and regular card) that are closed, and their inner content is rendered as markdown in the card.

Problem/Solution

Currently, we have image, or image-less cards. However, if we had a card that was implemented as a closed shortcode: e.g.

{{< card-closed >}}
//Insert inner content here
{{< /card-closed >}}

we would be able to create cards that have code snippets too. This would be quite useful for sites that want to show code snippets as part of a gallery.

Alternatives Considered

The alternative would be just to take a screenshot of the code snippets and use the image. However, this isn't nearly as good of a solution because it would not be reactive to light/dark theme switches

Additional Context

I have a somewhat working implementation in my CardsWithInner branch on my fork. The issue that I have with my implementation is that it could do with some additional CSS to make the code match with the card a little better. You can see examples of this in the documentation for hextra and cards in the same branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions