diff --git a/README.md b/README.md index 8a2cb25..bfc1abd 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ BackgroundImages = [ ] # optional background style (valid css only) BackgroundStyle = "background: #000000;" +# optional bool to have links open in a new window/tab (default: true) +OpenLinksInNewWindow = true # list of nav tags [[ params.nav ]] diff --git a/layouts/partials/tile.html b/layouts/partials/tile.html index d7e239f..4e2fe15 100644 --- a/layouts/partials/tile.html +++ b/layouts/partials/tile.html @@ -1,10 +1,10 @@ - +
- {{ if .img }}{{ else }}{{ .name }}{{ end }}
-
{{ .name }}
+ data-title='{{ .Link.name }}' + data-url='{{ .Link.url }}' + {{ if .Link.bg_color }}data-bg-color='{{ .Link.bg_color | safeCSS }}'{{ end -}} + {{ if .Link.txt_color }}data-txt-color='{{ .Link.txt_color | safeCSS }}'{{ end -}} + {{ if .Link.img }}data-img='{{ .Link.img }}'{{ end -}}> + {{ if .Link.img }}{{ else }}{{ .Link.name }}{{ end }} +
{{ .Link.name }}
diff --git a/layouts/partials/tile_slate.html b/layouts/partials/tile_slate.html index 4f31816..6e2945a 100644 --- a/layouts/partials/tile_slate.html +++ b/layouts/partials/tile_slate.html @@ -1,3 +1,3 @@ -
{{ range .Site.Data.links.tiles }} -{{ partial "tile.html" . }}{{ end }} +
{{$jump := .Site.Params.OpenLinksInNewWindow | default true }}{{ range .Site.Data.links.tiles }} +{{ partial "tile.html" (dict "Link" . "Jump" $jump)}}{{ end }}