# Hugo Terminal sets up all pages with a relative css path from root instead of where the page is located

**URL:** <https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771>\
**Category:** support\
**Created:** [July 30, 2022, 10:49am UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771 "2022-07-30T10:49:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arkid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arkid/32/17428_2.png) [@Arkid](https://discourse.gohugo.io/u/Arkid)\
**Post date:** [July 30, 2022, 10:49am UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771/1 "2022-07-30T10:49:25Z")

</div>

I deploy my site using `sudo $(which hugo) -D`  
In my config.toml I have `publishdir = '/var/www/html/'`

My /var/www/html/ looks like:

```auto
├── 404.html
├── assets
│ ├── 2078a57b79d547bf1e2502f8d249b867.woff
│ ├── 58cebbe9a6bdcba6d4bb56a22a9e812f.woff
│ ├── blue.css
│ ├── green.css
│ ├── languageSelector.js
│ ├── main.js
│ ├── pink.css
│ ├── prism.js
│ ├── red.css
│ └── style.css
├── categories
│ ├── index.html
│ └── index.xml
├── favicon.ico
├── icon
│ └── favicon.ico
├── img
│ └── favicon
├── index.html
├── index.xml
├── page
│ └── 1
├── posts
│ ├── first
│ ├── index.html
│ ├── index.xml
│ └── page
├── sitemap.xml
└── tags
    ├── index.html
    └── index.xml

```

My main site [here](https://aaarkid.co). looks fine, but if you press the first post you get greeted by a no css page. Upon close inspection one can see that css path in every page is `"assets/some.css"` when it should be something like `"../../assets/some.css"`. Any helpful suggestions on a solution?

---

<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:** [July 30, 2022, 5:59pm UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771/2 "2022-07-30T17:59:09Z")

</div>

Post a link to your repo so we can see the theme setup and help you out.

---

<div class="post-metadata">

**Author:** ![Arkid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arkid/32/17428_2.png) [@Arkid](https://discourse.gohugo.io/u/Arkid)\
**Post date:** [July 30, 2022, 9:20pm UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771/3 "2022-07-30T21:20:09Z")

</div>

Here is the Terminal theme I’ve added by `git add submodule`:

> **[GitHub - panr/hugo-theme-terminal: A simple, retro theme for Hugo](https://github.com/panr/hugo-theme-terminal)**
>
> A simple, retro theme for Hugo. Contribute to panr/hugo-theme-terminal development by creating an account on GitHub.

Here is my config.toml:

````nohighlight
title = "Arkid's Place"
theme = 'terminal'
publishdir = '/var/www/html/'
paginate = 5

[params]
contentTypeName = "posts"
themeColor = "blue"
showMenyItems = 2
fullWidthTheme = false
centerTheme = false
autoCover = false
favicon = "icon/favicon.ico"
showLastUpdated = true
readingTime = true
Toc = true
# TocTitle = "Table of Contents"```

Sorry, but I haven't and won't put my site in a repo, but I assume this is enough relevant data to make helping easier.
````

---

<div class="post-metadata">

**Author:** ![funkydan2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/funkydan2/32/5636_2.png) [@funkydan2](https://discourse.gohugo.io/u/funkydan2)\
**Post date:** [July 30, 2022, 9:41pm UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771/4 "2022-07-30T21:41:50Z")

</div>

> <https://github.com/panr/hugo-theme-terminal/blob/161096273113101926c90e6de31a955bdc66c235/layouts/partials/head.html#L13>

This is the line that generates the HTML for the CSS file. It uses the `absURL` function which generates a URL based on the `baseURL` variable, set in `config.toml`.

> **[absURL](https://gohugo.io/functions/absurl/#readout)**
>
> Creates an absolute URL based on the configured baseURL.

You don’t have `baseURL` set in your config file.

---

<div class="post-metadata">

**Author:** ![Arkid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arkid/32/17428_2.png) [@Arkid](https://discourse.gohugo.io/u/Arkid)\
**Post date:** [July 30, 2022, 10:45pm UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771/5 "2022-07-30T22:45:56Z")

</div>

Thank you, that sounds like my problem exactly. I didn’t want to put a baseUrl as I have 3 domains pointing to my site, but I assume that putting only one of them allows the page to pull the appropriate stylesheet which solves my issue.

So I went ahead and put one of my domains as the baseUrl and my problem was fixed.

---

<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:** [July 31, 2022, 2:31pm UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771/6 "2022-07-31T14:31:24Z")

</div>

@Arkid - If you have multiple deploys of the same code base, you can configure the base URL per deploy:

Via CLI with the `-b` option

Or via env var with `HUGO_BASEURL`

---

<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:** [August 2, 2022, 2:31pm UTC](https://discourse.gohugo.io/t/hugo-terminal-sets-up-all-pages-with-a-relative-css-path-from-root-instead-of-where-the-page-is-located/39771/7 "2022-08-02T14:31:36Z")

</div>

Closed on August 2, 2022, 2:31pm UTC

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