# Is it possible to download text from external URL

**URL:** <https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396>\
**Category:** support\
**Created:** [September 25, 2018, 3:30am UTC](https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396 "2018-09-25T03:30:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshaybabloo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/akshaybabloo/32/6844_2.png) [@akshaybabloo](https://discourse.gohugo.io/u/akshaybabloo)\
**Post date:** [September 25, 2018, 3:30am UTC](https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396/1 "2018-09-25T03:30:59Z")

</div>

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>
```

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [September 25, 2018, 6:35am UTC](https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396/2 "2018-09-25T06:35:53Z")

</div>

No this is not possible.

---

<div class="post-metadata">

**Author:** ![akshaybabloo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/akshaybabloo/32/6844_2.png) [@akshaybabloo](https://discourse.gohugo.io/u/akshaybabloo)\
**Post date:** [September 25, 2018, 8:57am UTC](https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396/3 "2018-09-25T08:57:38Z")

</div>

Opened a feature request at [https://github.com/gohugoio/hugo/issues/5255](https://github.com/gohugoio/hugo/issues/5255)

---

<div class="post-metadata">

**Author:** ![kisik21](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kisik21/32/6897_2.png) [@kisik21](https://discourse.gohugo.io/u/kisik21)\
**Post date:** [September 28, 2018, 5:54pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396/4 "2018-09-28T17:54:23Z")

</div>

> ```
> {{ $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?

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [September 28, 2018, 7:04pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396/5 "2018-09-28T19:04:03Z")

</div>

> [@kisik21](#):
>
> Why won’t you use `<style type="text/css" src="$url">` somewhere in the  
> body or in the template?

The `$url` you reference is external. The snippet in question would pull in the contents at build time and process them via `hugo`.

---

<div class="post-metadata">

**Author:** ![akshaybabloo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/akshaybabloo/32/6844_2.png) [@akshaybabloo](https://discourse.gohugo.io/u/akshaybabloo)\
**Post date:** [September 29, 2018, 12:22am UTC](https://discourse.gohugo.io/t/is-it-possible-to-download-text-from-external-url/14396/6 "2018-09-29T00:22:15Z")

</div>

That wouldn’t download the contents of the URL.
