mirror of
https://github.com/gesquive/slate.git
synced 2024-12-12 08:50:40 +01:00
add site var to control link destination
This commit is contained in:
parent
bb3a8251ef
commit
6890f1fbdf
@ -43,6 +43,8 @@ BackgroundImages = [
|
|||||||
]
|
]
|
||||||
# optional background style (valid css only)
|
# optional background style (valid css only)
|
||||||
BackgroundStyle = "background: #000000;"
|
BackgroundStyle = "background: #000000;"
|
||||||
|
# optional bool to have links open in a new window/tab (default: true)
|
||||||
|
OpenLinksInNewWindow = true
|
||||||
|
|
||||||
# list of nav tags
|
# list of nav tags
|
||||||
[[ params.nav ]]
|
[[ params.nav ]]
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<a class="tile tile-link" href="{{ .url }}" data-groups='{{ if .tags }}{{ delimit .tags "," }}{{ end }}'>
|
<a class="tile tile-link" href="{{ .Link.url }}" data-groups='{{ if .Link.tags }}{{ delimit .Link.tags "," }}{{ end }}'{{ if .Jump }} target="_blank"{{ end }}>
|
||||||
<div class="tile-box"
|
<div class="tile-box"
|
||||||
data-title='{{ .name }}'
|
data-title='{{ .Link.name }}'
|
||||||
data-url='{{ .url }}'
|
data-url='{{ .Link.url }}'
|
||||||
{{ if .bg_color }}data-bg-color='{{ .bg_color }}'{{ end -}}
|
{{ if .Link.bg_color }}data-bg-color='{{ .Link.bg_color | safeCSS }}'{{ end -}}
|
||||||
{{ if .txt_color }}data-txt-color='{{ .txt_color }}'{{ end -}}
|
{{ if .Link.txt_color }}data-txt-color='{{ .Link.txt_color | safeCSS }}'{{ end -}}
|
||||||
{{ if .img }}data-img='{{ .img }}'{{ end -}}>
|
{{ if .Link.img }}data-img='{{ .Link.img }}'{{ end -}}>
|
||||||
{{ if .img }}<img class="logo" src="{{ .img }}"></img>{{ else }}{{ .name }}{{ end }}</div>
|
{{ if .Link.img }}<img class="logo" src="{{ .Link.img }}"></img>{{ else }}{{ .Link.name }}{{ end }}</div>
|
||||||
<div class="tile-title">{{ .name }}</div>
|
<div class="tile-title">{{ .Link.name }}</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<div class="tile-container">{{ range .Site.Data.links.tiles }}
|
<div class="tile-container">{{$jump := .Site.Params.OpenLinksInNewWindow | default true }}{{ range .Site.Data.links.tiles }}
|
||||||
{{ partial "tile.html" . }}{{ end }}
|
{{ partial "tile.html" (dict "Link" . "Jump" $jump)}}{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user