Is it possible to get URL contents from an external site like getJSON
or getCSV
does? for example:
Something like:
{{ $externalCSS := .getCSS "https://fonts.googleapis.com/css?family=Space+Mono:400,700" }}
<style>
{{ $externalCSS.Content | safeCSS }}
</style>
kisik21
4
{{ $externalCSS := .getExternal "https://fonts.googleapis.com/css?family=Space+Mono:400,700" }}
<style>
{{ $externalCSS.Content | safeCSS }}
</style>
Why won’t you use <style type="text/css" src="$url">
somewhere in the
body or in the template?
maiki
5
The $url
you reference is external. The snippet in question would pull in the contents at build time and process them via hugo
.
That wouldn’t download the contents of the URL.