From 554d50523922729be20fb64f689bc9df8cb74129 Mon Sep 17 00:00:00 2001 From: jtbx Date: Mon, 2 Oct 2023 12:09:39 +0200 Subject: [PATCH] Shortcodes: Add font-awesome shortcode --- README.md | 8 ++++++++ layouts/shortcodes/fa.html | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 layouts/shortcodes/fa.html diff --git a/README.md b/README.md index c7859d5..763bc08 100644 --- a/README.md +++ b/README.md @@ -61,3 +61,11 @@ To create a new general blog post, run a command like this: ```shell hugo new content --king article blog/your-article-title.md ``` + +### Icons + +You can use solid and brand icons from https://fontawesome.com/icons version 6 in your posts like this: +```md +{{< fa envelope >}} +{{< fa brands gitlab >}} +``` diff --git a/layouts/shortcodes/fa.html b/layouts/shortcodes/fa.html new file mode 100644 index 0000000..7030e7a --- /dev/null +++ b/layouts/shortcodes/fa.html @@ -0,0 +1,6 @@ + +{{- $faStylePrefix := "fa-solid" }} +{{- if in (slice "fa-solid" "fa-brands") (.Get 0) }} + {{- $faStylePrefix = (.Get 0) }} +{{- end }} + \ No newline at end of file