From b1e8e00267c58753aeb3cc201f9bfa5feea17161 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Sat, 9 Dec 2023 21:40:30 +0000 Subject: [PATCH 1/8] Add keywords list component --- layouts/partials/keyword.html | 9 +++++++++ layouts/shortcodes/keyword.html | 1 + layouts/shortcodes/keywordList.html | 1 + 3 files changed, 11 insertions(+) create mode 100644 layouts/partials/keyword.html create mode 100644 layouts/shortcodes/keyword.html create mode 100644 layouts/shortcodes/keywordList.html diff --git a/layouts/partials/keyword.html b/layouts/partials/keyword.html new file mode 100644 index 00000000..9a5bbd6d --- /dev/null +++ b/layouts/partials/keyword.html @@ -0,0 +1,9 @@ + + + + {{ . }} + + + diff --git a/layouts/shortcodes/keyword.html b/layouts/shortcodes/keyword.html new file mode 100644 index 00000000..0453a36c --- /dev/null +++ b/layouts/shortcodes/keyword.html @@ -0,0 +1 @@ +{{ partial "keyword.html" .Inner }} diff --git a/layouts/shortcodes/keywordList.html b/layouts/shortcodes/keywordList.html new file mode 100644 index 00000000..ae87a068 --- /dev/null +++ b/layouts/shortcodes/keywordList.html @@ -0,0 +1 @@ +
{{- .Inner -}}
From 2791cc7cb9326da46bc991dc8b4c836250f87c79 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Wed, 20 Dec 2023 13:53:50 +0000 Subject: [PATCH 2/8] Pass icon as keyword argument to shortcode --- layouts/partials/keyword.html | 9 --------- layouts/shortcodes/keyword.html | 13 ++++++++++++- 2 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 layouts/partials/keyword.html diff --git a/layouts/partials/keyword.html b/layouts/partials/keyword.html deleted file mode 100644 index 9a5bbd6d..00000000 --- a/layouts/partials/keyword.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - {{ . }} - - - diff --git a/layouts/shortcodes/keyword.html b/layouts/shortcodes/keyword.html index 0453a36c..a954847a 100644 --- a/layouts/shortcodes/keyword.html +++ b/layouts/shortcodes/keyword.html @@ -1 +1,12 @@ -{{ partial "keyword.html" .Inner }} +{{ $icon := .Get "icon"}} + + + + {{if $icon}} + {{ partial "icon" $icon }} + {{ end }} {{- .Inner | markdownify -}} + + + From 3e818059718641b1750a41c9a2738b286f4b36f8 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Wed, 20 Dec 2023 15:01:03 +0000 Subject: [PATCH 3/8] Don't put margin around each keyword --- layouts/shortcodes/keyword.html | 16 +++++++--------- layouts/shortcodes/keywordList.html | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/layouts/shortcodes/keyword.html b/layouts/shortcodes/keyword.html index a954847a..ec870a0d 100644 --- a/layouts/shortcodes/keyword.html +++ b/layouts/shortcodes/keyword.html @@ -1,12 +1,10 @@ {{ $icon := .Get "icon"}} - - - - {{if $icon}} - {{ partial "icon" $icon }} - {{ end }} {{- .Inner | markdownify -}} - + + + {{if $icon}} + {{ partial "icon" $icon }} + {{ end }} {{- .Inner | markdownify -}} diff --git a/layouts/shortcodes/keywordList.html b/layouts/shortcodes/keywordList.html index ae87a068..22d89c60 100644 --- a/layouts/shortcodes/keywordList.html +++ b/layouts/shortcodes/keywordList.html @@ -1 +1 @@ -
{{- .Inner -}}
+
{{- .Inner -}}
From 46c119928956ba21154974e6d0ebb31401ae13ef Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Wed, 20 Dec 2023 15:01:25 +0000 Subject: [PATCH 4/8] Fix issue which can arise with formatting --- layouts/shortcodes/keyword.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/keyword.html b/layouts/shortcodes/keyword.html index ec870a0d..2248319b 100644 --- a/layouts/shortcodes/keyword.html +++ b/layouts/shortcodes/keyword.html @@ -2,9 +2,10 @@ - + {{if $icon}} {{ partial "icon" $icon }} - {{ end }} {{- .Inner | markdownify -}} + {{ end }} + {{- .Inner | markdownify -}} From 1358930b6e968954d7258f096fd54642344e1273 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Wed, 20 Dec 2023 15:04:32 +0000 Subject: [PATCH 5/8] Add documentation --- exampleSite/content/docs/shortcodes/index.md | 34 +++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 156bf607..810f416c 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -375,6 +375,38 @@ Inline notation can be generated by wrapping the expression in `\\(` and `\\)` d Check out the [mathematical notation samples]({{< ref "mathematical-notation" >}}) page for more examples. +


+ + +## Keyword + + +The `keyword` creates a visually distinguished keyword that can be used in different use-cases, e.g. professional skills etc. The `keyword` shortcode relies on the `keywordList` shortcode to group together keywords. Each item can have the following properties. + + + +| Parameter | Description | +| ----------- | -------------------------------------------- | +| `icon` | the icon to be used in the keyword | + + +The input is written in Markdown so you can format it however you please. + +**Example:** + +```md +{{}} +{{}} Lorem ipsum dolor. {{}} +{{}} **Important** skill {{}} +{{}} +``` + +{{< keywordList >}} +{{< keyword icon="github" >}} Lorem ipsum dolor {{< /keyword >}} +{{< keyword icon="code" >}} **Important** skill {{< /keyword >}} +{{< /keywordList >}} + +


## Lead @@ -393,7 +425,7 @@ When life gives you lemons, make lemonade. When life gives you lemons, make lemonade. {{< /lead >}} -


+


## List From 29d2cfd9b6234307406e649f4500216edf1428c9 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Wed, 20 Dec 2023 15:55:08 +0000 Subject: [PATCH 6/8] Update wording --- exampleSite/content/docs/shortcodes/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 810f416c..9ce4cb94 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -381,13 +381,13 @@ Check out the [mathematical notation samples]({{< ref "mathematical-notation" >} ## Keyword -The `keyword` creates a visually distinguished keyword that can be used in different use-cases, e.g. professional skills etc. The `keyword` shortcode relies on the `keywordList` shortcode to group together keywords. Each item can have the following properties. +The `keyword` component can be used to visually highlight certain important words or phrases, e.g. professional skills etc. The `keywordList` shortcode can be used to group together multiple `keyword` items. Each item can have the following properties. | Parameter | Description | | ----------- | -------------------------------------------- | -| `icon` | the icon to be used in the keyword | +| `icon` | Optional icon to be used in the keyword | The input is written in Markdown so you can format it however you please. From 86dc4b0ade138bb72a3744456e4261eb24948c39 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Wed, 20 Dec 2023 16:02:45 +0000 Subject: [PATCH 7/8] Increase vertical spacing --- layouts/shortcodes/keyword.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/shortcodes/keyword.html b/layouts/shortcodes/keyword.html index 2248319b..d8847679 100644 --- a/layouts/shortcodes/keyword.html +++ b/layouts/shortcodes/keyword.html @@ -1,4 +1,5 @@ {{ $icon := .Get "icon"}} +
@@ -9,3 +10,4 @@ {{- .Inner | markdownify -}} +
\ No newline at end of file From 6742e7f4eb750639d3b2bdafb86292e3b7dc4f46 Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Wed, 20 Dec 2023 16:03:11 +0000 Subject: [PATCH 8/8] Add example of standalone keyword --- exampleSite/content/docs/shortcodes/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 9ce4cb94..2be1440e 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -399,13 +399,14 @@ The input is written in Markdown so you can format it however you please. {{}} Lorem ipsum dolor. {{}} {{}} **Important** skill {{}} {{}} +{{}} *Standalone* skill {{}} ``` {{< keywordList >}} {{< keyword icon="github" >}} Lorem ipsum dolor {{< /keyword >}} {{< keyword icon="code" >}} **Important** skill {{< /keyword >}} {{< /keywordList >}} - +{{< keyword >}} *Standalone* skill {{< /keyword >}}