# Article compatibility with Github

**URL:** <https://discourse.gohugo.io/t/article-compatibility-with-github/11981>\
**Category:** Uncategorized\
**Created:** [May 14, 2018, 8:41pm UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981 "2018-05-14T20:41:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdupont](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cdupont/32/10037_2.png) [@cdupont](https://discourse.gohugo.io/u/cdupont)\
**Post date:** [May 14, 2018, 8:41pm UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/1 "2018-05-14T20:41:43Z")

</div>

I’d like to keep images close to my articles. I use the following structure:

```auto
/content/tutorials/_index.md
/content/tutorials/tutorial1/index.md
/content/tutorials/tutorial1/images/image.jpg

```

Here is my markdown:

```auto
![my picture](images/image.jpg)

```

This works well when rendered in Github.  
How should I write my front matter, to render it also in Hugo?  
I tried:

```auto
---
title: Urban waste management
resource:
    src: images/image.jpg
---

```

But the image is not accessible.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [May 14, 2018, 8:46pm UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/2 "2018-05-14T20:46:31Z")

</div>

If you use a recently new Hugo version, that should be possible, but it is impossible to judge by the little you post. A link to the site source would maybe help us help you.

---

<div class="post-metadata">

**Author:** ![cdupont](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cdupont/32/10037_2.png) [@cdupont](https://discourse.gohugo.io/u/cdupont)\
**Post date:** [May 14, 2018, 9:10pm UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/3 "2018-05-14T21:10:18Z")

</div>

Here is the file I’m working on: [https://github.com/Waziup/waziup.io/blob/hugo/content/tutorials/usecases/waste/\_index.md](https://github.com/Waziup/waziup.io/blob/hugo/content/tutorials/usecases/waste/_index.md)  
The images are located in: [https://github.com/Waziup/waziup.io/tree/hugo/content/tutorials/usecases/waste/images](https://github.com/Waziup/waziup.io/tree/hugo/content/tutorials/usecases/waste/images)

The pictures are rendering in Github, but not in Hugo.  
I use Hugo V0.38.2

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [May 14, 2018, 9:40pm UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/4 "2018-05-14T21:40:19Z")

</div>

You need to read up on bundles in Hugo, esp. around the distinction of leaf and branch bundles.

---

<div class="post-metadata">

**Author:** ![vassudanagunta](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vassudanagunta/32/4113_2.png) [@vassudanagunta](https://discourse.gohugo.io/u/vassudanagunta)\
**Post date:** [May 15, 2018, 7:35am UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/5 "2018-05-15T07:35:02Z")

</div>

@cdupont, it should work as-is (and you don’t need the `resource` front matter). I just downloaded your repo and it worked fine on my machine.

---

<div class="post-metadata">

**Author:** ![cdupont](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cdupont/32/10037_2.png) [@cdupont](https://discourse.gohugo.io/u/cdupont)\
**Post date:** [May 15, 2018, 7:39am UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/6 "2018-05-15T07:39:36Z")

</div>

@vassudanagunta really?  
I don’t see the photos in the article [http://localhost:1313/tutorials/usecases/waste](http://localhost:1313/tutorials/usecases/waste)  
Do you?  
What could it be? My version of Hugo? Should I clean some cache?

---

<div class="post-metadata">

**Author:** ![vassudanagunta](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vassudanagunta/32/4113_2.png) [@vassudanagunta](https://discourse.gohugo.io/u/vassudanagunta)\
**Post date:** [May 15, 2018, 7:48am UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/7 "2018-05-15T07:48:46Z")

</div>

Yup. Works perfectly for me on Hugo v0.40.3. I cloned your repo and ran Hugo against it as-is, no changes. But I don’t see why it shouldn’t work with v0.38.2. Good luck!

---

<div class="post-metadata">

**Author:** ![cdupont](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cdupont/32/10037_2.png) [@cdupont](https://discourse.gohugo.io/u/cdupont)\
**Post date:** [May 15, 2018, 8:02am UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/8 "2018-05-15T08:02:02Z")

</div>

@vassudanagunta thank you soooo much for helping me!!  
I see I didn’t commit correctly.  
Could you clone again?

```auto
git clone git@github.com:Waziup/waziup.io.git
git checkout hugo
hugo server &
firefox localhost:1313/tutorials/usecases/waste/index.html

```

I don’t see the first two pictures (waste\_bin.jpg and waste\_bin\_elec.jpg). However, they are in the folder ./images/

---

<div class="post-metadata">

**Author:** ![vassudanagunta](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vassudanagunta/32/4113_2.png) [@vassudanagunta](https://discourse.gohugo.io/u/vassudanagunta)\
**Post date:** [May 15, 2018, 8:13am UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/9 "2018-05-15T08:13:24Z")

</div>

Sorry brother, you have all the tools necessary to figure it out, since you can diff the working version on GitHub and the one that doesn’t work. I simply don’t have time to hold your hand, especially since you can do it yourself. Good luck!

---

<div class="post-metadata">

**Author:** ![cdupont](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cdupont/32/10037_2.png) [@cdupont](https://discourse.gohugo.io/u/cdupont)\
**Post date:** [May 15, 2018, 8:39am UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/10 "2018-05-15T08:39:42Z")

</div>

@vassudanagunta I find your reply slightly offending. If you don’t have time, you shouldn’t bother to reply at all 😉 That’s just my opinion.

Anyway, I think I found the answer: I had this in my head.html:

```auto
<script type="text/javascript">
  theBaseUrl = "http://" + location.host + "/";
  document.write('<base href="' + theBaseUrl + '"/>');
</script>

```

This “base href” would prevent any relative image src to open.  
I don’t know where this tag came from. God, I can tell you it’s been month this was bothering me! 😭😂

---

<div class="post-metadata">

**Author:** ![vassudanagunta](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vassudanagunta/32/4113_2.png) [@vassudanagunta](https://discourse.gohugo.io/u/vassudanagunta)\
**Post date:** [May 15, 2018, 2:37pm UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/11 "2018-05-15T14:37:33Z")

</div>

I took time to help you. And I provided the critical fact that you missed for a month: That the problem was introduced in your recent code changes since the checked-in version worked perfectly. Something you didn’t bother to do.

But then without spending any time to do the diff first, you immediately ask me to download your current code. You wanted me to do your work for you before you even tried.

It is I who should be offended for you not respecting other people’s time. Now I almost regret helping you. Almost.

vas

---

<div class="post-metadata">

**Author:** ![cdupont](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cdupont/32/10037_2.png) [@cdupont](https://discourse.gohugo.io/u/cdupont)\
**Post date:** [May 16, 2018, 8:44am UTC](https://discourse.gohugo.io/t/article-compatibility-with-github/11981/12 "2018-05-16T08:44:19Z")

</div>

I initially suspected that the problem was with my understanding or usage of Hugo… That’s why I posted here.  
Actually it was unrelated! The bundles was not working because of this “href base” (which was in my code base since forever)…  
Anyway, thanks for the help, it was useful to put me on track.
