It'll be nice to have a getCSS function for external URL where the caching are not in our hands and also if we want to make the CSS an inline version instead of adding a link to the external site. Maybe by doing something like:
{{ $externalCSS := .getCSS "https://fonts.googleapis.com/css?family=Space+Mono:400,700" }}
<style>
{{ $externalCSS.Content | safeCSS }}
</style>
I agree about the use case, and it has been discussed, and I guess it will eventually be implemented. But we have a fairly big API as it is, so I don't think we're going to add special getCSS etc. funcs. What I had in mind would be something like this:
{{ $externalCSS := resources.Get "https://fonts.googleapis.com/css?family=Space+Mono:400,700" }}
<style>
{{ $externalCSS.Content | safeCSS }} Or .RelPermalink would also work.
</style>
Which would work like you would expect it to. There may be licensing issues with the above construct, but I'm not sure Hugo should be the gatekeeper of those problems.
Ya that'll be fine too
I can also add to the above that I would also love to, eventually, move getJSON and getCSV into that same function ... if possible.
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
Most helpful comment
I agree about the use case, and it has been discussed, and I guess it will eventually be implemented. But we have a fairly big API as it is, so I don't think we're going to add special
getCSSetc. funcs. What I had in mind would be something like this:Which would work like you would expect it to. There may be licensing issues with the above construct, but I'm not sure Hugo should be the gatekeeper of those problems.