diff options
author | vjeantet <valere.jeantet@gmail.com> | 2020-09-06 15:15:16 +0300 |
---|---|---|
committer | vjeantet <valere.jeantet@gmail.com> | 2020-09-06 15:15:16 +0300 |
commit | 5db6546b9b192c712bc7c905512c8e3e998c8507 (patch) | |
tree | 99afa9b03b87767acae8f3148aff816526112864 | |
parent | 2adba13ee6ffebeab57307acb2073260619e2d07 (diff) |
shortcode button - link example
-rw-r--r-- | exampleSite/content/shortcodes/button/_index.md | 6 | ||||
-rw-r--r-- | layouts/shortcodes/button.html | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/exampleSite/content/shortcodes/button/_index.md b/exampleSite/content/shortcodes/button/_index.md index 2d781cd..23d2941 100644 --- a/exampleSite/content/shortcodes/button/_index.md +++ b/exampleSite/content/shortcodes/button/_index.md @@ -12,6 +12,7 @@ Display an actionable button in your page. | Parameter | Default | Description | |:--|:--|:--| | href | "" | The location href to link to | +| ref | "" | The reference of a page to link to | | align | "center" | horizontal align button on page | | theme | `primary` | `default`, `primary` , `success`,`info`,`warning`,`danger` | @@ -26,7 +27,7 @@ The inner text you place in short code will be displayed as the _button text_ {{</* button href="https://google.com" theme="danger" */>}} Danger ! {{</* /button */>}} {{</* button href="https://google.com" theme="dark" */>}} Dark ! {{</* /button */>}} {{</* button href="https://google.com" theme="light" */>}} Light ! {{</* /button */>}} - {{</* button href="https://google.com" theme="secondary" */>}} Secondary{{</*/button*/>}} + {{</* button ref="columns" theme="secondary" */>}} See page **columns**{{</*/button*/>}} ``` {{<button href="https://google.com" >}} go to google {{< /button >}} @@ -37,7 +38,8 @@ The inner text you place in short code will be displayed as the _button text_ {{<button href="https://google.com" theme="dark">}} Dark ! {{< /button >}} {{<button href="https://google.com" theme="light">}} Light ! {{< /button >}} -{{<button href="https://google.com" theme="secondary">}} Secondary ! {{< /button >}} +{{<button ref="columns" theme="secondary">}} See page **columns** ! {{< /button >}} + diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html index da8f5a8..75f0006 100644 --- a/layouts/shortcodes/button.html +++ b/layouts/shortcodes/button.html @@ -1,7 +1,7 @@ <!-- Boutton --> <link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/button.scss" | toCSS).Permalink }}'> {{ with .Get "align" }}<center>{{end}} -<button class="btn {{with .Get "theme"}}{{.}}{{else}}primary{{end}}" type="button" {{ with .Get "href" }} onclick="location.href='{{.}}'"{{end}} >{{.Inner}}</button> +<button class="btn {{with .Get "theme"}}{{.}}{{else}}primary{{end}}" type="button" {{ with .Get "href" }} onclick="location.href='{{.}}'"{{end}} {{ if .Get "ref" }} onclick="location.href='{{relref . (.Get "ref") }}'"{{end}}>{{.Inner | markdownify}}</button> {{ with .Get "align" }}</center>{{end}} <!-- Boutton -->
\ No newline at end of file |