diff --git a/daprdocs/content/en/contributing/contributing-docs.md b/daprdocs/content/en/contributing/contributing-docs.md index 1e73bda86..16567f2fc 100644 --- a/daprdocs/content/en/contributing/contributing-docs.md +++ b/daprdocs/content/en/contributing/contributing-docs.md @@ -334,6 +334,8 @@ The shortcode would be: To create a button in a webpage, use the `button` shortcode. +An optional "newtab" parameter will indicate if the page should open in a new tab. Options are "true" or "false". Default is "false", where the page will open in the same tab. + #### Link to an external page ``` @@ -346,10 +348,10 @@ To create a button in a webpage, use the `button` shortcode. You can also reference pages in your button as well: ``` -{{}} +{{}} ``` -{{< button text="My Button" page="contributing" >}} +{{< button text="My Button" page="contributing" newtab="true" >}} #### Button colors diff --git a/daprdocs/layouts/shortcodes/button.html b/daprdocs/layouts/shortcodes/button.html index 5ab0ddc9b..24419146c 100644 --- a/daprdocs/layouts/shortcodes/button.html +++ b/daprdocs/layouts/shortcodes/button.html @@ -2,7 +2,8 @@ {{ $page := .Get "page" }} {{ $link := .Get "link" | default "#" }} {{ $text := .Get "text" }} +{{ $newtab := .Get "newtab" | default "false" }} {{- if $page -}}{{- $link = ref . $page -}}{{- end -}} -{{ $text }} +{{ $text }}