blogcard shortcode

Published

September 14, 2024

Blogcard Extension For Quarto

blogcard shortcode makes easy to produce a card-like link.

Installing

To use blogcard extension in your Quarto project, run this command in terminal at the project’s working directory. This will install the extension under the _extensions subdirectory.

quarto add t-arae/blogcard

and then, apply blogcard filter by adding this lines into your yaml header of .qmd file.

filters:
  - blogcard

How to use

To make a card by blogcard shortcode, write shortcode directive like this.

{{< blogcard https://quarto.org >}}
Quarto

An open source technical publishing system for creating beautiful articles, websites, blogs, books, slides, and more. Supports Python, R, Julia, and JavaScript.

https://quarto.org

The first argument of blogcard shortcode will be used as the URL. You can also pass the URL through the keyword argment like this.

{{< blogcard url=https://quarto.org >}}
or 
{{< blogcard url="https://quarto.org" >}}
Quarto

An open source technical publishing system for creating beautiful articles, websites, blogs, books, slides, and more. Supports Python, R, Julia, and JavaScript.

https://quarto.org

Template selection

{{< blogcard https://quarto.org tname="template2" >}}

When no open graph protocol tags are found

blogcard shortcode uses the content of <meta> tag containning the open graph protocol (OGP), to make a card. If no OGP contents are found (or failed to get HTML contents), it makes a deadly simple card.

{{< blogcard https://example.com >}}

https://example.com

Manually set the data

You can also set the contents manually through keyword argments.

{{< blogcard https://example.com title="This is title" description="No description" image="https://via.placeholder.com/300x200" >}}
This is title

No description

https://example.com