# Problem with Gitlab

**URL:** <https://discourse.gohugo.io/t/problem-with-gitlab/18013>\
**Category:** support\
**Created:** [April 9, 2019, 6:45pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013 "2019-04-09T18:45:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukzmu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lukzmu/32/8340_2.png) [@lukzmu](https://discourse.gohugo.io/u/lukzmu)\
**Post date:** [April 9, 2019, 6:45pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/1 "2019-04-09T18:45:05Z")

</div>

Hello there, I have a little problem with my Hugo website. I am posting this on Gitlab Pages. When I run locally, the index page is working just fine. When it lands on gitlab pages, no matter what I have in `index.html` it doesn’t show the contents at all as it can be seen on [my website](https://zmudzinski.me).

Here is the code for the `index.html`, which displays a page with blog posts that aren’t pages. On localhost it just works.

```auto
{{ define "main" }}
<div class="content">
    <main class="posts">
        {{- if .Content }}
            <div class="content">{{ .Content }}</div>
        {{- end }}
        {{- range .Data.Pages.GroupByDate "2006" }}
            {{- if not (eq .Key "0001") }}
                <div class="posts-group">
                    <div class="post-year">{{ .Key }}</div>

                    <ul class="posts-list">
                        {{- range .Pages }}
                            <li class="post-item">
                                <a href="{{.Permalink}}">
                                    <span class="post-title">{{.Title}}</span>
                                    <span class="post-day">{{ if .Site.Params.dateformShort }}{{ .Date.Format .Site.Params.dateformShort }}{{ else }}{{ .Date.Format "Jan 02"}}{{ end }}</span>
                                </a>
                            </li>
                        {{- end }}
                    </ul>
                </div>
            {{- end }}
        {{- end }}
    </main>
</div>
{{ end }}

```

I can’t find the problem why the index page doesn’t work correctly after uploading it to gitlab.

---

<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:** [April 9, 2019, 7:07pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/2 "2019-04-09T19:07:45Z")

</div>

There must be some difference in the command arguments you’re passing when running `hugo server` vs when you run your `hugo` command to build/push to GitLab Pages. Perhaps you’re building drafts/future pages locally, but not in your build script?

---

<div class="post-metadata">

**Author:** ![lukzmu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lukzmu/32/8340_2.png) [@lukzmu](https://discourse.gohugo.io/u/lukzmu)\
**Post date:** [April 9, 2019, 7:30pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/3 "2019-04-09T19:30:18Z")

</div>

This is the Gitlab build file:

```auto
# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
image: registry.gitlab.com/pages/hugo:latest

variables:
  GIT_SUBMODULE_STRATEGY: recursive

test:
  script:
  - hugo
  except:
  - master

pages:
  script:
  - hugo
  artifacts:
    paths:
    - public
  only:
  - master

```

Locally I just run `hugo server`.

---

<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:** [April 9, 2019, 7:42pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/4 "2019-04-09T19:42:16Z")

</div>

Hmm. Something else going on then. Share your code and we can better help you.

---

<div class="post-metadata">

**Author:** ![lukzmu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lukzmu/32/8340_2.png) [@lukzmu](https://discourse.gohugo.io/u/lukzmu)\
**Post date:** [April 9, 2019, 7:43pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/5 "2019-04-09T19:43:29Z")

</div>

> **[Lukasz Zmudzinski / lukzmu.gitlab.io](https://gitlab.com/lukzmu/lukzmu.gitlab.io)**
>
> Personal website based on Hugo.

Here you go, made the project public.

---

<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:** [April 9, 2019, 7:48pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/6 "2019-04-09T19:48:51Z")

</div>

Cloned your repo. Looks fine locally for me as well. (i’m running Hugo version 0.55.0)

My guess is it’s still something gitlab-related. Maybe others with more knowledge in that area can help you

---

<div class="post-metadata">

**Author:** ![appernetic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/appernetic/32/1464_2.png) [@appernetic](https://discourse.gohugo.io/u/appernetic)\
**Post date:** [April 9, 2019, 7:51pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/7 "2019-04-09T19:51:41Z")

</div>

I have recently set up a couple of sites on GitLab. Have you checked that the settings is correct such as this:

 ![settings](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/5/55c09df8cd605dbf5b1bd7ad551fc3c630edb3e4.png)

and this:

 ![PagesSettings](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/5/51428284e2894d6f14eeb0e250121e4d7ad2df74.png)

The baseURL can be a bit tricky also.

I have tried with:

baseURL= “”

and

baseURL = “[https://fitnessrebels.gitlab.io](https://fitnessrebels.gitlab.io)”

both works, but I suspect that you don’t get a useful sitemap with the first one.

Sometimes you also have to run the CI Pipeline manualy the first time…

You can check my working repo here: [https://gitlab.com/fitnessrebels/](https://gitlab.com/fitnessrebels/)

---

<div class="post-metadata">

**Author:** ![appernetic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/appernetic/32/1464_2.png) [@appernetic](https://discourse.gohugo.io/u/appernetic)\
**Post date:** [April 9, 2019, 7:59pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/8 "2019-04-09T19:59:40Z")

</div>

Great! You seem to have made it work.

---

<div class="post-metadata">

**Author:** ![lukzmu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lukzmu/32/8340_2.png) [@lukzmu](https://discourse.gohugo.io/u/lukzmu)\
**Post date:** [April 9, 2019, 8:01pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/9 "2019-04-09T20:01:40Z")

</div>

I tried changing the baseurl but the index still isn’t working like it should.  
I don’t have the list of blog posts, just a blank page with the header and footer.

---

<div class="post-metadata">

**Author:** ![lukzmu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lukzmu/32/8340_2.png) [@lukzmu](https://discourse.gohugo.io/u/lukzmu)\
**Post date:** [April 9, 2019, 8:02pm UTC](https://discourse.gohugo.io/t/problem-with-gitlab/18013/10 "2019-04-09T20:02:50Z")

</div>

This is how it looks locally:

 ![Przechwytywanie](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/7/75419cff2b0601bd28f8aeef5e74b461ef7204e2.png)
