Ver código fonte

Correct boolean logic of sameSite variable

Apis Necros 2 anos atrás
pai
commit
5f72c34347
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      layouts/_default/_markup/render-link.html

+ 3 - 3
layouts/_default/_markup/render-link.html

@@ -1,6 +1,6 @@
-{{- $sameSite := false -}}
-{{- if eq (.Destination | relURL) (.Destination | absURL) }}{{ $sameSite = true }}{{ end -}}
+{{- $sameSite := true -}}
+{{- if eq (.Destination | relURL) (.Destination | absURL) }}{{ $sameSite = false }}{{ end -}}
 <a href="{{ .Destination }}"
-    {{- if $sameSite }} target="_blank"
+    {{- if not $sameSite }} target="_blank"
         {{- with .Title }} rel="{{ . | safeHTML }}"{{ end }}
     {{- else }} rel="me"{{ end }}>{{.Text | safeHTML}}</a>