# Site breaking after deployment

**URL:** <https://discourse.gohugo.io/t/site-breaking-after-deployment/47481>\
**Category:** support\
**Created:** [December 17, 2023, 9:23pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481 "2023-12-17T21:23:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarrylAT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/darrylat/32/20867_2.png) [@DarrylAT](https://discourse.gohugo.io/u/DarrylAT)\
**Post date:** [December 17, 2023, 9:23pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/1 "2023-12-17T21:23:29Z")

</div>

Hello everyone, I am new to Hugo and I have been struggling with an issue for a few days, so any help would be appreciated.  
I have developed a website locally with Hugo using the [Poison](https://github.com/lukeorth/poison) theme. As soon as I change the baseURL to `"https://<username>.github.io/<repository>"` all my different pages stop working (About, Posts, and Projects) and they lead to a 404 error like this

 ![Github-pages-404-eror](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/d/a/dacc7fceab99baf798cdde8a6234b349233eb652.png)

My logo image (called brand image in the theme) loads properly **locally** even after changing the baseURL value but after the deployment on Github pages, it breaks. The theme guide states that:  
**NOTE** : To display an image in your sidebar, you’ll need to uncomment the `brand_image` path below and have it point to an image file in your project. The path is relative to the `static` directory. In my hugo.toml file I have done just that and like I said it works locally but breaks after deployment even though the path is still the same, I am trying to solve this issue too. Thanks in advance!

[Public repository](https://github.com/DarrylAT/scorpiosec)

---

<div class="post-metadata">

**Author:** ![Arif](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arif/32/20931_2.png) [@Arif](https://discourse.gohugo.io/u/Arif)\
**Post date:** [December 17, 2023, 11:31pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/2 "2023-12-17T23:31:33Z")

</div>

Check your `baseURL`. It points to a subdirectory `https://darrylat.github.io/scorpiosec/`. Note that if you intend to use a custom domain, it should match your `baseURL` including the `https` protocol.

---

<div class="post-metadata">

**Author:** ![DarrylAT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/darrylat/32/20867_2.png) [@DarrylAT](https://discourse.gohugo.io/u/DarrylAT)\
**Post date:** [December 18, 2023, 12:26am UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/3 "2023-12-18T00:26:05Z")

</div>

How so? It is pointing to the main directory that is hosting all the Hugo files. I followed the " Hosting and deployment " documentation on the Hugo website. If that is wrong what should the URL be? I do plan on using a custom domain later, but I want the site to be functional before I buy the domain.  
I see that the baseURL should follow this style `baseURL = "https://<username>.github.io/<repository>"` which it does in my case. The link was provided after I used Github actions to deploy the site

---

<div class="post-metadata">

**Author:** ![Arif](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arif/32/20931_2.png) [@Arif](https://discourse.gohugo.io/u/Arif)\
**Post date:** [December 18, 2023, 7:13am UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/4 "2023-12-18T07:13:31Z")

</div>

> [@DarrylAT](#):
>
> all my different pages stop working (About, Posts, and Projects) and they lead to a 404 error like this

Check the URL you typed and your baseURL. They are not the same. E.g `https://darrylat.github.io/scorpiosec/about` works.

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [December 18, 2023, 7:42am UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/5 "2023-12-18T07:42:42Z")

</div>

The “posion” theme does not have full support for running the site in a sub directory.

It is mainly in the sidebar the issues arise.

The sidebar menu e.g. does not use Hugos menu system opting instead for a custom solution.

You define the menu items in a “menu” param:

```auto
    menu = [
        {Name = "About", URL = "/about/", HasChildren = false},
        {Name = "Posts", URL = "/posts/", Pre = "Recent", HasChildren = true, Limit = 5},
        {Name = "Projects", URL = "/projects/"},
    ]

```

The theme uses the URL values as is, without running them via any of Hugos URL functions. This way the link do not know anything about the sub directory and then become:

`https://darrylat.github.io/about/`

instead of:

`https://darrylat.github.io/scorpiosec/about/`

You can politely ask the theme author if they are interested in working on this issue.

Another “fix” is to update all the URLs on your site to have the sub directory hardcoded. But if you ever move the site to a proper domain you will need to redo that.

---

<div class="post-metadata">

**Author:** ![DarrylAT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/darrylat/32/20867_2.png) [@DarrylAT](https://discourse.gohugo.io/u/DarrylAT)\
**Post date:** [December 18, 2023, 1:43pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/6 "2023-12-18T13:43:32Z")

</div>

I didn’t type this URL specifically, after deploying the website I tried to navigate the website as a normal user and notice that all the pages are breaking. I see now that is because it is using the wrong URL but that is the issue I don’t know why it is doing that. Same as to why the logo image is not showing despite following the instructions provided by the theme’s docs.

---

<div class="post-metadata">

**Author:** ![DarrylAT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/darrylat/32/20867_2.png) [@DarrylAT](https://discourse.gohugo.io/u/DarrylAT)\
**Post date:** [December 18, 2023, 1:52pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/7 "2023-12-18T13:52:42Z")

</div>

@frjo

> [@frjo](#):
>
> Another “fix” is to update all the URLs on your site to have the sub directory hardcoded. But if you ever move the site to a proper domain you will need to redo that.

First thank you for your detailed answer, I understand the issue better now.

So if I understand correctly I will need to specify the URLs in the menu param as in  
`URL = "https://darrylat.github.io/scorpiosec/about/"` for the About page for example, and do the same for the Posts page and Project page too?

Do you think the logo image breaking is also caused by the same issue?

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [December 18, 2023, 2:20pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/8 "2023-12-18T14:20:43Z")

</div>

Only `URL = "/scorpiosec/about/"` is needed.

The logo src points to `/images/redscorpio.jpg` so yes, definitely the same issue since the logo in reality is in `/scorpiosec/images/redscorpio.jpg`

---

<div class="post-metadata">

**Author:** ![DarrylAT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/darrylat/32/20867_2.png) [@DarrylAT](https://discourse.gohugo.io/u/DarrylAT)\
**Post date:** [December 18, 2023, 6:08pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/9 "2023-12-18T18:08:26Z")

</div>

I think the theme (or I don’t know what else at this point) does not recognize that URL I tried the new one `{Name = "About", URL = "/scorpiosec/about/", HasChildren = false},` and it does not work. It just removes the About section

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 18, 2023, 6:21pm UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/10 "2023-12-18T18:21:29Z")

</div>

As @frjo described, the “posion” theme

1. Does not have full support for running the site in a sub directory
2. Does not use Hugo’s menu system

Please raise an issue with the theme author:  
[https://github.com/lukeorth/poison/issues](https://github.com/lukeorth/poison/issues)

---

<div class="post-metadata">

**Author:** ![DarrylAT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/darrylat/32/20867_2.png) [@DarrylAT](https://discourse.gohugo.io/u/DarrylAT)\
**Post date:** [December 19, 2023, 1:03am UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/11 "2023-12-19T01:03:05Z")

</div>

okay thanks, will do

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [December 21, 2023, 1:04am UTC](https://discourse.gohugo.io/t/site-breaking-after-deployment/47481/12 "2023-12-21T01:04:03Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
