Skip to content

Commit

Permalink
Add new Shortcode "page-resource"
Browse files Browse the repository at this point in the history
  • Loading branch information
jhauraw committed Jul 8, 2020
1 parent 52e4684 commit 8e0a04d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/shortcodes/page-resource.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- $r := .Get 0 }}
{{- $pr := .Page.Resources.GetMatch (printf "*%s*" $r) }}
{{- if not $pr }}
{{- errorf "Page resource '%s' was not found. Shortcode: 'page-resource'." $r }}
{{- end }}
{{- $pr.Content | safeHTML }}

0 comments on commit 8e0a04d

Please sign in to comment.