# Theme working on local, but not hosted

**URL:** <https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541>\
**Category:** support\
**Created:** [July 21, 2017, 10:12pm UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541 "2017-07-21T22:12:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![AakLak](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/aaklak/32/5627_2.png) [@AakLak](https://discourse.gohugo.io/u/AakLak)\
**Post date:** [July 21, 2017, 10:12pm UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/1 "2017-07-21T22:12:06Z")

</div>

My theme is applied fine on local server, but the Netlify hosted version doesn’t style properly.  
Same codebase. Theme was installed as a submodule.

Left: Hosted - Right: Local  
[![](https://d1ro8r1rbfn3jf.cloudfront.net/ms_138872/mO3pEwnMd8rLVms8IQkLZbMAAb8sip/AakLak%252B2017-07-21%252B14-46-15.png%2B%25281920%25C3%25971178%2529%2B%25F0%259F%2594%258A%2B2017-07-21%2B15-08-58.png?Expires=1513814679&Signature=Xusx0EeA4smyL2ra9613ICwvLY9tR-97XS1Xj3BSMh4grnjWtgTTPiIArPCkObdOkEBO-PKkGpRsiPJD~wzpzsgHQJyN8WOcple9p7Rn8-fwZuGOLIUp~obDT4LUStwLkWbNT9Xk5bDydJpImauFhhWcV1o-~MTeCE4kx3MUb~Z~eKBYZk0rRWJRH7BStmrSEBvzhuk9nnGpxjUthWmp9v-SKReMW-p24BMkIi9NuEx1mEog4upLBLZAsQLmXoihDkxfbfJX60e3ifqcMA6XtvQUwmhAbE3CMiKqLoPWi9Q46fnf30vmXU0nwZ2oyb6MRp7Loq6tZDBWKtr5OpbDVA__&Key-Pair-Id=APKAJHEJJBIZWFB73RSA) ](https://d1ro8r1rbfn3jf.cloudfront.net/ms_138872/mO3pEwnMd8rLVms8IQkLZbMAAb8sip/AakLak%252B2017-07-21%252B14-46-15.png%2B%25281920%25C3%25971178%2529%2B%25F0%259F%2594%258A%2B2017-07-21%2B15-08-58.png?Expires=1513814679&Signature=Xusx0EeA4smyL2ra9613ICwvLY9tR-97XS1Xj3BSMh4grnjWtgTTPiIArPCkObdOkEBO-PKkGpRsiPJD~wzpzsgHQJyN8WOcple9p7Rn8-fwZuGOLIUp~obDT4LUStwLkWbNT9Xk5bDydJpImauFhhWcV1o-~MTeCE4kx3MUb~Z~eKBYZk0rRWJRH7BStmrSEBvzhuk9nnGpxjUthWmp9v-SKReMW-p24BMkIi9NuEx1mEog4upLBLZAsQLmXoihDkxfbfJX60e3ifqcMA6XtvQUwmhAbE3CMiKqLoPWi9Q46fnf30vmXU0nwZ2oyb6MRp7Loq6tZDBWKtr5OpbDVA__&Key-Pair-Id=APKAJHEJJBIZWFB73RSA)

I think this may have something to do with the “baseurl” setting on my config.tom.  
It’s currently set to baseurl="/" and works on local.  
I tried changing it to my site’s url “[https://linguist-weld-60884.netlify.com/](https://linguist-weld-60884.netlify.com/)” but still didn’t apply them on deploy.

Using:  
[Victor Hugo Boilerplate](https://github.com/netlify/victor-hugo)

Thanks

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 22, 2017, 1:06am UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/2 "2017-07-22T01:06:24Z")

</div>

is your theme cloned or submoduled into your local repo? of it’s cloned, it won’t work on Netlify, if it’s submoduled, or hardwired into your folder structure (basically cloned but remove all the .git files/folders from the theme directories), then it ought to work.

---

<div class="post-metadata">

**Author:** ![AakLak](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/aaklak/32/5627_2.png) [@AakLak](https://discourse.gohugo.io/u/AakLak)\
**Post date:** [July 22, 2017, 1:22am UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/3 "2017-07-22T01:22:56Z")

</div>

I installed the theme as a submodule.

> $ git submodule add [GitHub - halogenica/beautifulhugo: Theme for the Hugo static website generator](https://github.com/halogenica/beautifulhugo.git)  
> $ git submodule init  
> $ git submodule update

thanks.

To clarify, should it work on Netlify with baseurl as “/” or should I set it to my URL?

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 22, 2017, 4:18am UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/4 "2017-07-22T04:18:35Z")

</div>

you only use “/” when you are working locally and you have no references to permalinks anywhere in you theme or site. otherwise, you need to reference the full address with the trailing slash. Also, make sure your build command is correct, since you are using victor hugo, there is more complexity there than there needs to be for a basic site build and deploy. Victor Hugo is good for a more complex asset (images, etc.) pipeline (processing, resizing, compressing, etc.). I use Netlify but I use the basic Hugo build command (with the environmental variable in the netlify site settings set to HUGO\_VERSION = 0.25.1 or whatever your version is. But either way, it really should still work, but because of the extra build process, I wouldn’t know where to begin to troubleshoot.

---

<div class="post-metadata">

**Author:** ![RHEV](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rhev/32/3715_2.png) [@RHEV](https://discourse.gohugo.io/u/RHEV)\
**Post date:** [July 22, 2017, 5:10pm UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/5 "2017-07-22T17:10:39Z")

</div>

Give this a shot. Go to your site settings in Netlify and under the Post Processing Settings, check the “Disable Asset Optimization” checkbox as shown below, and then redeploy.

 ![](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/4/41f1188e91ad10f65068276d9637903ad8a4cd5b.png)

If this fixes it, try to disable them one by one and see which is causing the issues. It’s likely it could be from CSS or JS optimization.

Once you figure out which one it is, I would go ahead and try to fix the issue so that you can enable the asset optimization again.

This is all based upon checking the box actually solving your issue. If checking the box and redeploying does not solve the issue, the instructions after the image won’t be of any use to you, however I think this could likely be the issue.

Let me know!

---

<div class="post-metadata">

**Author:** ![AakLak](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/aaklak/32/5627_2.png) [@AakLak](https://discourse.gohugo.io/u/AakLak)\
**Post date:** [July 23, 2017, 8:03am UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/7 "2017-07-23T08:03:04Z")

</div>

New finding.  
I noticed that even locally, my theme doesn’t apply… until I hit ctrl+s on any site file in my ext editor.  
At which point the page reloads itself, and correct css is applied.

Starting my server  
site [master] :\> npm start

> victor-hugo@1.0.0 start /Users/aakash/Documents/workspace/victor-hugo  
> gulp server  
> [00:22:28] Requiring external module babel-register  
> [00:22:32] Using gulpfile ~/Documents/workspace/victor-hugo/gulpfile.babel.js  
> [00:22:32] Starting ‘hugo’…  
> [00:22:32] Starting ‘css’…  
> INFO 2017/07/23 00:22:33 Using config file:  
> INFO 2017/07/23 00:22:33 using a UnionFS for static directory comprised of:  
> INFO 2017/07/23 00:22:33 Base: /Users/aakash/Documents/workspace/victor-hugo/site/themes/beautifulhugo/static  
> INFO 2017/07/23 00:22:33 Overlay: /Users/aakash/Documents/workspace/victor-hugo/site/static/  
> INFO 2017/07/23 00:22:33 syncing static files to /Users/aakash/Documents/workspace/victor-hugo/dist/  
> Started building sites …  
> INFO 2017/07/23 00:22:33 found taxonomies: map[string]string{“tag”:“tags”, “category”:“categories”}  
> INFO 2017/07/23 00:22:33 Alias “/tags/hugo/page/1/index.html” translated to “tags/hugo/page/1/index.html”  
> INFO 2017/07/23 00:22:33 Alias “/page/1/index.html” translated to “page/1/index.html”  
> INFO 2017/07/23 00:22:33 Alias “/tags/netlify/page/1/index.html” translated to “tags/netlify/page/1/index.html”  
> INFO 2017/07/23 00:22:33 Alias “/post/page/1/index.html” translated to “post/page/1/index.html”  
> Built site for language en:  
> 0 draft content  
> 0 future content  
> 0 expired content  
> 1 regular pages created  
> 12 other pages created  
> 0 non-page files copied  
> 4 paginator pages created  
> 2 tags created  
> 0 categories created  
> total in 59 ms  
> [00:22:34] Starting ‘js’…  
> [00:22:34] Finished ‘hugo’ after 1.94 s  
> [00:22:35] Finished ‘css’ after 2.27 s  
> [00:22:35] [webpack] Hash: 9ed7bfd9bde7e1bdbf38  
> Version: webpack 2.7.0  
> Time: 464ms  
> Asset Size Chunks Chunk Names  
> app.js 2.82 kB 0 [emitted] app  
> chunk {0} app.js (app) 73 bytes [entry] [rendered]  
> [0] ./src/js/app.js 45 bytes {0} [built]  
> [1] multi ./js/app 28 bytes {0} [built]  
> [00:22:35] Finished ‘js’ after 743 ms  
> [00:22:35] Starting ‘server’…  
> [00:22:35] Finished ‘server’ after 97 ms  
> [Browsersync] Access URLs:  
> Local: [http://localhost:3000](http://localhost:3000)  
> External: [http://192.168.0.105:3000](http://192.168.0.105:3000)  
> UI: [http://localhost:3001](http://localhost:3001)  
> UI External: [http://192.168.0.105:3001](http://192.168.0.105:3001)  
> [Browsersync] Serving files from: ./dist

At this point theme css is not applied.  
I notice that my main.css file doesn’t contain the theme’s css, until…  
I hit save on my text editor, no changes made.

> [00:22:44] Starting ‘hugo’…  
> INFO 2017/07/23 00:22:44 Using config file:  
> INFO 2017/07/23 00:22:44 using a UnionFS for static directory comprised of:  
> INFO 2017/07/23 00:22:44 Base: /Users/aakash/Documents/workspace/victor-hugo/site/themes/beautifulhugo/static  
> INFO 2017/07/23 00:22:44 Overlay: /Users/aakash/Documents/workspace/victor-hugo/site/static/  
> INFO 2017/07/23 00:22:44 syncing static files to /Users/aakash/Documents/workspace/victor-hugo/dist/  
> Started building sites …  
> INFO 2017/07/23 00:22:45 found taxonomies: map[string]string{“tag”:“tags”, “category”:“categories”}  
> INFO 2017/07/23 00:22:45 Alias “/tags/hugo/page/1/index.html” translated to “tags/hugo/page/1/index.html”  
> INFO 2017/07/23 00:22:45 Alias “/page/1/index.html” translated to “page/1/index.html”  
> INFO 2017/07/23 00:22:45 Alias “/post/page/1/index.html” translated to “post/page/1/index.html”  
> INFO 2017/07/23 00:22:45 Alias “/tags/netlify/page/1/index.html” translated to “tags/netlify/page/1/index.html”  
> Built site for language en:  
> 0 draft content  
> 0 future content  
> 0 expired content  
> 1 regular pages created  
> 12 other pages created  
> 0 non-page files copied  
> 4 paginator pages created  
> 2 tags created  
> 0 categories created  
> total in 22 ms  
> [Browsersync] Reloading Browsers…  
> [00:22:45] Finished ‘hugo’ after 365 ms

And now my main.css has the theme’s css.

Any clue why this would be happening?  
Any other info/debug I could provide?

Thanks @gaetawoo & @RHEV

---

<div class="post-metadata">

**Author:** ![williamhgough](https://avatars.discourse-cdn.com/v4/letter/w/82dd89/32.png) [@williamhgough](https://discourse.gohugo.io/u/williamhgough)\
**Post date:** [July 23, 2017, 6:21pm UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/8 "2017-07-23T18:21:27Z")

</div>

I’m seeing the same as above!

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 23, 2017, 6:56pm UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/9 "2017-07-23T18:56:51Z")

</div>

Do you _have_ to be using Victor Hugo?? it seems like this is your first site… I highly suggest starting with basic Hugo, not Victor Hugo. I say wipe the directory clean, and start fresh using tutorials on the docs site (quick start) or on the digital ocean site (search digital ocean hugo) or forestry hugo getting started

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [July 23, 2017, 9:10pm UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/10 "2017-07-23T21:10:34Z")

</div>

> [@gaetawoo](#):
>
> I highly suggest starting with basic Hugo, not Victor Hugo

Or be sure to post an issue in the Victor Hugo repo on Netlify’s GitHub. From what I know of the project, it’s set up with Webpack to allow for a simple NPM start to get everything up and running. If you’re having trouble with livereload or themes being applied, I am sure they would love to know.

---

<div class="post-metadata">

**Author:** ![AakLak](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/aaklak/32/5627_2.png) [@AakLak](https://discourse.gohugo.io/u/AakLak)\
**Post date:** [July 24, 2017, 10:55pm UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/11 "2017-07-24T22:55:19Z")

</div>

Thanks @gaetawoo & @rdwatters  
Everything’s working now.  
Same setup, without the Victor-Hugo boilerplate

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 25, 2017, 2:17am UTC](https://discourse.gohugo.io/t/theme-working-on-local-but-not-hosted/7541/12 "2017-07-25T02:17:19Z")

</div>

That’s great news! Glad it worked out!
