mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 20:15:25 +00:00
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:
1 parent
b585d9207b
commit
170204126a
1 file changed
+14
@@ -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>
|
||||
Reference in new issue
Block a user