Sfoglia il codice sorgente

Correct boolean logic of sameSite variable

Apis Necros 2 anni fa
parent
commit
5f72c34347
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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>