# Adding a javascript heavy html page?

**URL:** <https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681>\
**Category:** support\
**Created:** [January 28, 2019, 4:23am UTC](https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681 "2019-01-28T04:23:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/amca/32/5608_2.png) [@amca](https://discourse.gohugo.io/u/amca)\
**Post date:** [January 28, 2019, 4:23am UTC](https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681/1 "2019-01-28T04:23:03Z")

</div>

I have an interactive map I’d like to display; it has been created with a lot of javascript in it. I could take the entire html file of the map and put it between some `script` tags, and this is how I’ve incorporated javascript in my blog before: see [https://numbersandshapes.net/post/egg\_graphs/](https://numbersandshapes.net/post/egg_graphs/) for an example.

But I don’t want to clutter my markdown with 7675 lines of code!

How can I read in the contents of an html+javascript file into my hugo blog without having to display the source of entire file itself? Thanks!

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [January 28, 2019, 4:32am UTC](https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681/2 "2019-01-28T04:32:48Z")

</div>

You could put the JS into a shortcode

---

<div class="post-metadata">

**Author:** ![amca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/amca/32/5608_2.png) [@amca](https://discourse.gohugo.io/u/amca)\
**Post date:** [January 28, 2019, 4:33am UTC](https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681/3 "2019-01-28T04:33:58Z")

</div>

Thank you - but I’ve not much experience with shortcodes. I can simply add a link to the file, of course, but it would be nice for the map to appear on the page of its explanatory post.

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [January 28, 2019, 4:39am UTC](https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681/4 "2019-01-28T04:39:07Z")

</div>

Yep, this can be accomplished with a shortcode. You would place your JS in the shortcode, then call it from your content file. I recommend giving the docs on them a read

---

<div class="post-metadata">

**Author:** ![amca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/amca/32/5608_2.png) [@amca](https://discourse.gohugo.io/u/amca)\
**Post date:** [January 28, 2019, 4:45am UTC](https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681/5 "2019-01-28T04:45:30Z")

</div>

Thank you again - so far I haven’t found what I want in the docs, but I’ll keep looking. I was hoping something like

```
#+begin_src html
/url-of-map.html
#+end_src

```

would work, but clearly I need something more sophisticated than that.

---

<div class="post-metadata">

**Author:** ![amca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/amca/32/5608_2.png) [@amca](https://discourse.gohugo.io/u/amca)\
**Post date:** [January 28, 2019, 5:39am UTC](https://discourse.gohugo.io/t/adding-a-javascript-heavy-html-page/16681/6 "2019-01-28T05:39:07Z")

</div>

I solved it by putting it into an iframe. Simple and effective!
