get in touch button dynamic link support - #155

This commit is contained in:
gurusabarish
2024-03-09 19:04:52 +05:30
parent 68eb034fdf
commit 4687d53336
2 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -352,8 +352,8 @@ params:
enable: true enable: true
# title: "Custom Name" # title: "Custom Name"
content: My inbox is always open. Whether you have a question or just want to say hi, Ill try my best to get back to you! content: My inbox is always open. Whether you have a question or just want to say hi, Ill try my best to get back to you!
email: [email protected]
btnName: Mail me btnName: Mail me
btnLink: mailto:[email protected]
# formspree: # formspree:
# enable: true # `contact.email` value will be ignored # enable: true # `contact.email` value will be ignored
# formId: abcdefgh # Take it from your form's endpoint, like 'https://formspree.io/f/abcdefgh' # formId: abcdefgh # Take it from your form's endpoint, like 'https://formspree.io/f/abcdefgh'
+10 -2
View File
@@ -22,9 +22,17 @@
</div> </div>
</form> </form>
</div> </div>
{{ else if .Site.Params.contact.email }} {{ else if or (.Site.Params.contact.email) (.Site.Params.contact.btnLink) }}
<div class="text-center pt-3"> <div class="text-center pt-3">
<a href="mailto:{{ .Site.Params.contact.email }}" class="btn"> <a
href='{{ if .Site.Params.contact.btnLink }}
{{ .Site.Params.contact.btnLink | default "#" }}
{{ else }}
mailto:{{ .Site.Params.contact.email }}
{{ end }}'
target="_blank"
class="btn"
>
{{ .Site.Params.contact.btnName | default "Get in Touch" }} {{ .Site.Params.contact.btnName | default "Get in Touch" }}
</a> </a>
</div> </div>