Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding mailto: #208

Closed
Ads7 opened this issue Oct 15, 2017 · 4 comments
Closed

adding mailto: #208

Ads7 opened this issue Oct 15, 2017 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@Ads7
Copy link

Ads7 commented Oct 15, 2017

Wish to add a mailto:[email protected] in menu links simply adding that to URL appends it with the host URL. Could you guide how to go about it

@kakawait
Copy link
Owner

@Ads7 did you try with url = "mailto:[email protected]" on menu link param (I didn't test by myself)

[[menu.links]]
  weight = 1
  identifier = "email"
  name = "Email me"
  url = "mailto:[email protected]"

@kakawait kakawait added the waiting for feedback We need additional information before we can continue label Oct 23, 2017
@kakawait kakawait added the question Further information is requested label Nov 12, 2017
@AlexandreCantin
Copy link

I've tried by my side url="mailto:..." and it's not working...
I've fixed this issue by editing menu.html (line 3)

    {{ if and (or (in .URL "://") (in .URL "mailto:")) (not (in .URL (printf "%s" $.root.Site.BaseURL))) }}

@kakawait
Copy link
Owner

@AlexandreCantin Thank for you feedback I will add it on theme

@kakawait kakawait added enhancement New feature or request and removed waiting for feedback We need additional information before we can continue labels Nov 26, 2017
@kakawait kakawait added this to the 0.4.4-BETA milestone Nov 26, 2017
@xiaoyunyang
Copy link

The suggested solution above causes a new tab to be opened when mailto is clicked. Instead of combining the mailto stuff with the external link stuff, a new if branch should be created just for mailto:

{{ if and (in .URL "mailto:") (not (in .URL (printf "%s" $.root.Site.BaseURL))) }}
<a class="sidebar-button-link {{ if eq .Identifier "search" }}open-algolia-search{{ end }}" href="{{ .URL | safeURL }}" rel="noopener">
{{ else if and (in .URL "://") (not (in .URL (printf "%s" $.root.Site.BaseURL))) }}
<a class="sidebar-button-link {{ if eq .Identifier "search" }}open-algolia-search{{ end }}" href="{{ .URL | safeURL }}" target="_blank" rel="noopener">

@kakawait kakawait added fixed on develop and removed question Further information is requested labels Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants