hugo-cloak-email icon indicating copy to clipboard operation
hugo-cloak-email copied to clipboard

Add option for default email address from config

Open Brixy opened this issue 4 years ago • 5 comments

I use your brilliant shortcode heavily in many projects. Now I had to change all email addresses in one of them. So this is what I am using now:

In cloakemail.html:

{{- $address := .Get "address" | default .Site.Params.themeSettings.cloakemail -}}

config.yaml:

params:
  themeSettings:
    cloakemail: "[email protected]"
    …

Does this make sense to you? Yet, other user might prefer a default phone number etc. So an address in this format address="emaildefault" might make more sense.

Thank you!

Brixy avatar Mar 05 '20 15:03 Brixy

Good idea. Would you prepare a PR for this?

martignoni avatar Mar 06 '20 15:03 martignoni

Ok. I am happy to do that. I have that about a good and downward compatible solution. It will take a few days as I am on the road right now.

Brixy avatar Mar 08 '20 10:03 Brixy

I suppose it requires cloakemail.svg

I implemented it and it says

"svgs/social/cloakemail.svg" not found render of "page" failed:

"svgs/social/" $name ".svg") (dict "width" 25 "height" 25)>: partial "svgs/social/cloakemail.svg" not found failed to render pages:

partial "svgs/social/cloakemail.svg" not found

What I did was to find email.svg file copy it as cloakemail.svg.

sysadmin-info avatar Mar 17 '23 08:03 sysadmin-info

Absolutely nothing to do with any image. You must be confusing.

martignoni avatar Mar 17 '23 13:03 martignoni

Absolutely nothing to do with any image. You must be confusing.

the error comes from the zzo theme. Theme is using svg files as icons. Anyway it is made the way it is looking for a proper svg name because it has a pattern defined. So I just copied the email.svg to cloakemail.svg and it did the job. I just thought that someone would like to know how to solve it.

sysadmin-info avatar Mar 18 '23 22:03 sysadmin-info