Skip to content

Shortcodes for Quarto pages, used by Statistics Greenland

License

StatisticsGreenland/statgl-shortcodes

Repository files navigation

Statgl-shortcodes Extension For Quarto

A Quarto extension that provides custom shortcodes for displaying structured statistics from Statistics Greenland. The shortcodes make it easier to render KPI cards, highlight boxes, and other elements commonly used for public-facing statistical content.

Installing

quarto add StatisticsGreenland/statgl-shortcodes

This will install the extension under the _extensions subdirectory. If you're using version control, you will want to check in this directory.

Using

To use the extension, include it in your Quarto project’s _quarto.yml:

project:
  type: website

contributes:
  shortcodes:
    - statgl-shortcodes

To enable styling, you need to include styles.css manually in your Quarto project:

format:
  html:
    css: _extensions/StatisticsGreenland/statgl-shortcodes/styles.css

You can then use the provided shortcodes in your .qmd files.

Examples

KPI card

{{< kpicard 
  title = "Population" 
  subtitle = "As of January 2025" 
  value = "56,542" 
>}}

📈 Plotbox

{{< plotbox
  title = "Population over time"
  description = "From 1979 onwards"
  plot = '`r statgl::statgl_plot(statgl::statgl_fetch("BEXSTA"), time)`'
  link = "[See all poplation stats](https://example.com/population)"
  accordion = "Details and Method"
  more = "Here is a place to learn more about the graph"
>}}

📦 Feature

{{< feature
  eyebrow = "New Release"
  title = "2024 Population Forecast"
  subtitle = "Projections to 2050"
  icon = "bi-calendar3"
  body = "The forecast is based on birth rates, mortality, and net migration. §§§
          Projections are updated annually."
  link = "/forecast/population"
>}}

📇 Contact

{{< contact
  title = "Contact the Author"
  phone = "+299 123456"
  mail = "[email protected]"
  icon = "bi-person-square"
>}}

About

Shortcodes for Quarto pages, used by Statistics Greenland

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published