Ver código fonte

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 :rocket:" >}}

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 :rocket:" cta_alt_link="./my-page/" cta_alt_text="Go to my page" >}}
George Cushen 4 anos atrás
pai
commit
170204126a
1 arquivos alterados com 14 adições e 0 exclusões
  1. 14 0
      wowchemy/layouts/shortcodes/cta.html

+ 14 - 0
wowchemy/layouts/shortcodes/cta.html

@@ -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>