feat(shortcode): add cta shortcode for call to action buttons

Examples

Main button CTA:

{{< cta cta_link="https://..." cta_new_tab="true" cta_text="emoji 🚀" >}}

Alternative text CTA:

{{< cta cta_alt_link="./my-page/" cta_alt_text="Go to my page" >}}

Main button CTA and alternative text CTA:

{{< cta cta_link="https://..." cta_new_tab="true" cta_text="emoji 🚀" cta_alt_link="./my-page/" cta_alt_text="Go to my page" >}}
This commit is contained in:
George Cushen committed 2020-09-27 00:19:35 +01:00
1 parent b585d9207b
commit 170204126a
1 file changed
+14
+14
View File
@@ -0,0 +1,14 @@
<ul class="cta-group">
{{ if (.Get "cta_text") }}
<li>
<a href="{{.Get "cta_link"}}" {{if eq (.Get "cta_new_tab") "true" }}target="_blank"{{end}} class="btn btn-primary px-3 py-3">{{ (.Get "cta_text") | markdownify | emojify }}</a>
</li>
{{ end }}
{{ if (.Get "cta_alt_text") }}
<li>
<a href="{{.Get "cta_alt_link"}}" {{if eq (.Get "cta_alt_new_tab") "true" }}target="_blank"{{end}}>
{{ (.Get "cta_alt_text") | markdownify | emojify }} <i class="fas fa-angle-right"></i>
</a>
</li>
{{end}}
</ul>