We can store content from external projects yay
This commit is contained in:
10
themes/kitsune-theme/layouts/shortcodes/image.html
Normal file
10
themes/kitsune-theme/layouts/shortcodes/image.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{/* This never really worked but its cool to be able to make shortcodes like this for use in MD */}}
|
||||
|
||||
{{ $image := .Page.Resources.GetMatch (printf "*%s" (.Get 0)) }}
|
||||
{{ if $image }}
|
||||
<img src="{{ $image.RelPermalink }}" alt="{{ $image.Title }}">
|
||||
{{ else }}
|
||||
|
||||
<!-- Would be cool to make an error-box for stuff like this in css -->
|
||||
<p>Serverside shortcode Error, couldn't load {{ .Get 0 }}</p>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,7 @@
|
||||
{{/* This custom shortcode lets me list all the resources available. Pretty cool yeah? */}}
|
||||
|
||||
<ul>
|
||||
{{ range .Page.Resources }}
|
||||
<li>{{ .RelPermalink }} - {{ .ResourceType }} - {{ .Name }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
Reference in New Issue
Block a user