Skip to content

Instantly share code, notes, and snippets.

@hwayne
Last active January 28, 2018 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hwayne/fe731cfbc730c7b4835fe07ef403391d to your computer and use it in GitHub Desktop.
Save hwayne/fe731cfbc730c7b4835fe07ef403391d to your computer and use it in GitHub Desktop.
person shortcode
{{ with index $.Site.Data.person (.Get 0) }}
{{ if .site }}
{{ printf "[%s](%s)" .name .site | markdownify }}
{{ else }}
{{ .name }}
{{ end }}
{{ end }}
person_with_site:
name: "Dorkus McKlorkus"
site: "https://www.example.com"
person_without_site:
name: "Hurf McDurf"
@hwayne
Copy link
Author

hwayne commented Jan 28, 2018

html goes in layouts/shortcodes, yml goes in data, call with {{% person person_whatever_site %}}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment