Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme not rendering, pathing issues #1421

Closed
Fthree opened this issue Sep 11, 2015 · 12 comments
Closed

Theme not rendering, pathing issues #1421

Fthree opened this issue Sep 11, 2015 · 12 comments
Labels

Comments

@Fthree
Copy link

Fthree commented Sep 11, 2015

I've followed the https://gohugo.io/overview/quickstart/

I then followed the https://gohugo.io/overview/usage/ on deployment on a hugo-only server.

I run the server with:
sudo hugo server --bind=0.0.0.0 --port=80 --theme=hyde

I end up with a non-css/js site. This all works locally, however.

when I attempt to open the site in chrome I get " Failed to load resource: the server responded with a status of 404 (Not Found) " on "http://localhost/css/hyde.css, syntax.css and poole.css". I assume my Pathing is incorrect somewhere.

All files remained untouched, the config.toml included (meaning, it is the default version when creating a site using hugo new site command)

I'm working on an EC2 Ubuntu.

@bep
Copy link
Member

bep commented Sep 11, 2015

What is your baseURL setting ... and how does that compare to the hostname in use?

@Fthree
Copy link
Author

Fthree commented Sep 11, 2015

Hello bep,

baseurl = "http://replace-this-with-your-hugo-site.com/"

I'm currently connecting to the ec2 using the public ip, http://52.11.165.33/ should I change the baseurl to this ip?

@anthonyfok
Copy link
Member

Hi @Fthree,

Please read http://gohugo.io/overview/usage/ again and note the options, then try the following:

sudo hugo server --theme=hyde --bind=0.0.0.0 --baseUrl=http://52.11.165.33/ --port=80 --appendPort=false

@Fthree
Copy link
Author

Fthree commented Sep 11, 2015

@anthonyfok I knew it was something simple that I was missing. The baseUrl got me, thank you very much. I'll give that page another thorough read.

@Fthree Fthree closed this as completed Sep 11, 2015
@anthonyfok
Copy link
Member

If I recall correctly, whenever the "hugo server" subcommand is used, the baseurl setting in your config.toml or config.yaml is ignored, and instead got substituted by localhost, so you will have to set --baseUrl on the command-line. I wonder if the documentation mentions this or not. (This problem got me too, haha.)

@Fthree
Copy link
Author

Fthree commented Sep 11, 2015

Thank you, I really appreciate your help. The whole thing is still a little bit foreign to me, glad you came through to my help! So the config.toml baseurl is overwritten for the command line --baseUrl? I attempted editing the config.toml baseUrl to the IP to no success.

@anthonyfok
Copy link
Member

Yes, it is somewhat tricky. hugo server is most often used for local development, and so hugo server ignores the baseurl variable in config.toml and substitutes it with http://localhost:1313/ so the CSS and JS would load properly.

That's why we need to explicitly override hugo server's own overrides (haha) to get hugo server to work on a production server, hence the explicit --port 80 and --baseUrl=http://yourhostname.com/ on the command-line.

If you are interested, please read #852 for a more thorough discussion. Perhaps eventually we will add a new option called --production perhaps, so that sane defaults will be provided when the user runs hugo server --production.

@combinatorist
Copy link

@anthonyfok's point above was what I needed. It would be great if this were part of the tutorials.

The Quickstart led me to use the Ananke Theme, which lead me to their example site to understand their config, which gave no indication that you have to change the baseUrl (since they are apparently using hugo server.

In fact, this all could have been prevented for me if the gitlab tutorial had simply mentioned you would need to change your baseUrl. Right here would have been perfect: https://gohugo.io/hosting-and-deployment/hosting-on-gitlab/#wait-for-your-page-to-build

Instead, I tried messing with git submodules on gitlab to make sure I had that right, or trying to put the akanke them inside my public folder, and a bunch of other things. :(

@yashika51
Copy link

Hi, I was able to set the baseURL properly. I am rendering hugo with github pages.
It deploys and I get to see my site with the URL but the theme is totally messed up. It's just simple text, nothing from the theme gets outputted.

@Flix01
Copy link

Flix01 commented Dec 5, 2020

@yashika51: the same happens to me (first time I use Hugo and first time I use Github Pages as well). I'm using the zzo theme.

P.S. The preview with hugo server -D works perfectly.

[Edit:] It works now. It seems that the theme files took more time to get uploaded to the Github server... I just waited and then everything worked as expected.

@mrfoxie
Copy link

mrfoxie commented Dec 23, 2020

@yashika51: the same happens to me (first time I use Hugo and first time I use Github Pages as well). I'm using the zzo theme.

P.S. The preview with hugo server -D works perfectly.

I'm also using the same theme zzo and I'm changing dark theme colour but it doesn't have any effect on it I tried using hugo server -D --verbose but still don't have an effect on the theme

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants