Explorar o código

Correct boolean logic of sameSite variable

Apis Necros %!s(int64=2) %!d(string=hai) anos
pai
achega
5f72c34347
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  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>