{{ $params := . }} {{ $page := $params.page }} {{ $url := $params.url }} {{ $result := "" }} {{ if (urls.Parse $url).Scheme }} {{ with try (resources.GetRemote $url) }} {{ with .Err }} {{ errorf "layouts/partials/paige/func-resource.html: cannot get remote resource %q: %v" $url . }} {{ else with .Value }} {{ $result = . }} {{ else }} {{ errorf "layouts/partials/paige/func-resource.html: remote resource %q not found" $url }} {{ end }} {{ end }} {{ end }} {{ if and (not $result) $page }} {{ with $page.Resources.GetMatch $url }} {{ $result = . }} {{ else }} {{ with $page.Resources.Get $url }} {{ $result = . }} {{ end }} {{ end }} {{ end }} {{ if not $result }} {{ with resources.GetMatch $url }} {{ $result = . }} {{ else }} {{ with resources.Get $url }} {{ $result = . }} {{ end }} {{ end }} {{ end }} {{ return $result }}