I know this has been asked before, but I still can’t get it to work. I have got Hugo working fine locally with the simple but effective kiera theme, and I have copied all relevant files to my VPS for serving using apache. And I have made a small apache config file for this reason.
I have checked that all drafts are set to false, and once on the server I ran hugo --theme=kiera just to make sure everything was going in the correct place. However, the web page served up doesn’t contain any of the theme elements: it’s just text. I’ve tried running Hugo with other themes; doesn’t make any difference.
How can I ensure that the theme is set on my server?
Do you run hugo local and then copy the contents of the /public folder over to the website? What you write sounds to me like you are trying to have the source files running hugo on the server which is not what a “static” website does
Thank you - well in fact I’ve tried both. But surely if I have Hugo installed on my server, I can run Hugo just as well there to create the website? The thing about a static website, I understand, is that you create the blog post first, and then serve up a finished completed item.
My server URL, say http://myserver.org points to my wordpress.org blog. So I’ve set my baseurl to be http://myserver.orf/blog and I’ve set up an apache site so that this URL points to the Hugo public folder I’m trying to serve.
If you can share your project files, say in a github repo, it will help us help you.
You mention that the published site does not contain the theme elements. Sounds like your apache server cannot find your css file. That is usually something to do with, as @lucperkins points out, the baseURL config, or, it could be something wrong with the way you specified the link to the css file in your head template.
Thank you; I’ll try that later. Currently, I’ve tried setting baseurl to be “”, “http://myserver.org”. and “http://myserver.org/blog” - all this in my local config.toml file. After each change, I’ve run Hugo locally and then transferred the files to my server using rsync.
In fact the best result I’ve got so far is setting the baseurl to be “./” which does indeed show the base page nicely, but not any of the blog posts. That is to say, in the file public/index.html the stylesheet points to the correct file. But in public/blogpost/index.html it doesn’t.
I’ve also tried, as an experiment, setting baseurl to “file:///home/me/Blog/public” but that didn’t work either.
You’d think that getting apache to play nicely with something as simple as a static site would be trivial!
That sounds like you have the stylesheet called as a relative path, if it works for one but not the other. Again though, I cannot verify without the site url (so I can at least view source) or a repo to look at.
I’m also about to be off line for about 8 hours, as I’m going out for the day (I’m in Australia, where it’s late morning) - but I’l resume this conversation later. And thank you for your help! It’s much appreciated.