HomeBikeshedComponents

absURL.html

Published: Updated:

Gets the absolute URL of a path, else returns the string if not found. Useful for videos.

Source Code

{{- $url := .Get 0 -}}
{{- with or (.Page.Resources.GetMatch $url) (resources.Get $url) -}}
    {{- .Permalink -}}
{{- else -}}
    {{- absURL $url -}}
{{- end -}}

TODO

  • I need to find a better way of referencing videos. It’s good enough for now but I really need to improve it.