From 475bed99cf218c7e5e18b71a1c830f11b3fc8c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Guti=C3=A9rrez=20Moreno?= Date: Sun, 6 Nov 2022 13:09:56 +0100 Subject: [PATCH 1/3] Update button to add download tag --- layouts/shortcodes/button.html | 1 + 1 file changed, 1 insertion(+) diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html index c6a4c36b..6ca55e9d 100644 --- a/layouts/shortcodes/button.html +++ b/layouts/shortcodes/button.html @@ -2,6 +2,7 @@ class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700" {{ with .Get "href" }}href="{{ . }}"{{ end }} {{ with .Get "target" }}target="{{ . }}"{{ end }} + {{ with .Get "download"}}download="{{ . }}"{{ end }} role="button" > {{ .Inner }} From a6a0ecdb07a60b1baeeb0583739be41561a14226 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 7 Nov 2022 16:31:28 +1100 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Reformat=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/shortcodes/button.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html index 6ca55e9d..2789a6ba 100644 --- a/layouts/shortcodes/button.html +++ b/layouts/shortcodes/button.html @@ -2,7 +2,7 @@ class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700" {{ with .Get "href" }}href="{{ . }}"{{ end }} {{ with .Get "target" }}target="{{ . }}"{{ end }} - {{ with .Get "download"}}download="{{ . }}"{{ end }} + {{ with .Get "download" }}download="{{ . }}"{{ end }} role="button" > {{ .Inner }} From ce34ea05b725c31768c6aeff3efc880fa9acd9ff Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 7 Nov 2022 16:35:21 +1100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9D=20Update=20shortcode=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exampleSite/content/docs/shortcodes/index.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 8e34a339..ed0e2d4b 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -55,7 +55,15 @@ New article! ## Button -`button` outputs a styled button component which can be used to highlight a primary action. It has two optional variables `href` and `target` which can be used to specify the URL and target of the link. +`button` outputs a styled button component which can be used to highlight a primary action. It has three optional parameters: + + +|Parameter|Description| +|---|---| +|`href`|The URL that the button should link to.| +|`target`|The target of the link.| +|`download`|Whether browser should download the resource rather than navigate to the URL. The value of this parameter will be the name of the downloaded file.| + **Example:**