Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit e909936

Browse files
author
Tyler Mauthe
committed
Allow event_link to also pull event data
1 parent 1f8138b commit e909936

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

layouts/shortcodes/event_link.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
{{- $e := (index $.Site.Data.events (index (split ($.Page.Permalink | relURL) "/") 2)) -}}
2-
<a href = "{{ (printf "events/%s/%s" $e.name (.Get "page")) | absURL }}">{{ .Get "text" }}</a>
2+
{{- $url := index $e (.Get "url-key") | default (printf "events/%s/%s" $e.name (.Get "page")) | absURL -}}
3+
{{- $txt := index $e (.Get "text-key") | default (.Get "text") -}}
4+
5+
<a href = "{{ $url }}">{{ $txt }}</a>

0 commit comments

Comments
 (0)