Add option to not open the socials link on a new page, i.e. for an extra email page

I've added a ``nonewpage`` parameter to social links to avoid popping them open on a new page. This is useful, for example, for adding an email page that is resistant to scraping.

As an example:
``
[[params.social]]
  name = "email"
  url  = "/email"
  nonewpage = true
``

Where /email.md is a page that says something like ``domain at domain dot tld``.
This commit is contained in:
Andrey 2024-04-09 17:02:44 +03:00 committed by GitHub
parent 51e697bea7
commit 04c8f86fdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,3 @@
{{ range . -}} {{ range . -}}
&nbsp; <a href="{{ .url }}" target="_blank" rel="me noopener {{ .rel }}" title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a> &nbsp; &nbsp; <a href="{{ .url }}" {{if eq .nonewpage 0}} target="_blank" {{end}} rel="me noopener {{ .rel }}" title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a> &nbsp;
{{- end -}} {{- end -}}