# .RelPermalink not expected behaviour when hugo build

**URL:** <https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484>\
**Category:** support\
**Created:** [March 1, 2021, 5:08pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484 "2021-03-01T17:08:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DatsGabs](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@DatsGabs](https://discourse.gohugo.io/u/DatsGabs)\
**Post date:** [March 1, 2021, 5:08pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484/1 "2021-03-01T17:08:01Z")

</div>

I was working with the .RelPermalink on the hugo server and when I exported it with the hugo command it wasn’t working at all.

The .RelPermalink are basically baseURL + .RelPermalink when expected behaviour would be just the relative path. Am I doing something incorrectly or is there a way to go around this?

---

<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:** [March 1, 2021, 6:04pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484/2 "2021-03-01T18:04:20Z")

</div>

> [@DatsGabs](#):
>
> Am I doing something incorrectly or is there a way to go around this?

We cannot know what is going on without seeing the project in question or if that is not possible then share a sample repo that reproduces the behavior you encountered.

---

<div class="post-metadata">

**Author:** ![DatsGabs](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@DatsGabs](https://discourse.gohugo.io/u/DatsGabs)\
**Post date:** [March 1, 2021, 6:08pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484/3 "2021-03-01T18:08:03Z")

</div>

The project is literally just listing .Site.RegularPages and using .RelPermalink.  
Relative links appear as [example.com/blog/1](http://example.com/blog/1) instead of /blog/1, for example

---

<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:** [March 1, 2021, 6:17pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484/4 "2021-03-01T18:17:17Z")

</div>

> [@DatsGabs](#):
>
> Relative links appear as `example.com/blog/1` nstead of `/blog/1`, for example

I’ve already said what needs to be done.

Relative permalinks in projects I manage are rendered in the form of `/blog/1`.

Since you are reporting that on your end that does not work, people in this forum need to see the full context of the project, since this behavior can be due to several factors like global permalink configuration, hard-coded URLs in templates etc.

Also have a look at the [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132) topic or use the forum search.

---

<div class="post-metadata">

**Author:** ![DatsGabs](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@DatsGabs](https://discourse.gohugo.io/u/DatsGabs)\
**Post date:** [March 1, 2021, 7:25pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484/5 "2021-03-01T19:25:52Z")

</div>

Here is the project in Github, also I setted up the Github Pages so that you can see what’s the output.

> **[DatsGabs/datsgabs.github.io](https://github.com/DatsGabs/datsgabs.github.io)**
>
> Contribute to DatsGabs/datsgabs.github.io development by creating an account on GitHub.

---

<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:** [March 1, 2021, 8:09pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484/6 "2021-03-01T20:09:13Z")

</div>

Your `baseURL` in config.toml is incorrect. Please change:

```auto
baseURL = "datsgabs.github.io"

```

to

```auto
baseURL = "https://datsgabs.github.io/"

```

---

<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:** [March 3, 2021, 8:09pm UTC](https://discourse.gohugo.io/t/relpermalink-not-expected-behaviour-when-hugo-build/31484/7 "2021-03-03T20:09:49Z")

</div>

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