I’m a newbie in web development and I followed the steps to get the site running in local with a theme I selected. When I try uploading the site folder to Github, I see that not all folders are actually uploaded and the site doesn’t work as expected (like it does in local). I’m not sure what am I missing and I tried going thru the documents for no avail. May be I’m overlooking something or not looking in the right place or could be something else. I’m really hoping to get some help here in getting me started with my first website.
Thanks in Advance
How did you go about ‘uploading to Github’? Can you tell us what commands you ran? Can you link to your repository?
Thanks for the response. I followed the tutorial on Hugo.
After creating a new site.
CD folder name
and then installed the theme I used Hugo-fresh
Then uploaded to the remote repository by following the tutorial again
On terminal the status is all good but on the git repo it’s not the same - as in some folders are missing.
GitHub.com/vikramhimanshu/himanshu-page is the repo we’ Talking about
Thanks for that. What you need to do is add the rest of your files to your git repository. There are instructions for the command line here.
However, I find it much easier to use a GUI like sourcetree or the git features built into the atom text editor (your favourite editor may well have git features built-in).
I tried doing it manually and also tried using Tower Git to do it and it still won’t work. The main folder is Git enabled but the folders within are not in git (they don’t even show up as untracked). When I tried adding them manually Using Git add command it still won’t work. I don’t get an error but nothing happens.
Start over. Start a test site, to test uploading a functioning site to GitHub. Once you’ve gone through it a couple of times you’ll begin to understand what each step is doing. And you need to learn git and GitHub on your own, we can’t help with those.
Thanks. Figured that the empty directories were not being added so added them by adding a .gitignore file in each one of them. After which the structure on my local now matches the remote. Nevertheless, the local works fine but the remote is still not working.
Link to the site
Ok - git doesn’t track empty directories - that’s the design. You can see this by looking at your resources directory. On github, all the empty directories under
resources are greyed out until you get down to the sass directory.
So now it’s time for the next problem. What do you mean that ‘remote isn’t working’? Where are you trying to host your site? Based on the baseURL setting in your config file, my guess is you want to host on github pages. Have you followed the instructions for doing this?
I did follow the instructions as listed here ; https://gohugo.io/hosting-and-deployment/hosting-on-github/#github-project-pages
attached a are couple screen shots
In those instructions it says
hugo , push your master branch to the remote repository and choose the
docs/ folder as the website source of your repo.
What this means is on your local machine you need to run the
hugo command (not
hugo server). This will build your site inside the
docs folder (which is currently empty). When you push to GitHub, GitHub Pages will publish the files inside the
docs as your live website.
Thanks for the help!! It’s finally is getting close. The site is being severed now after running “hugo” command. Its not rendering exactly though. I see a loader/spinner instead of content.
So I looked at your site using the Firefox developer console…
Problem is your site is being served over https, but you’ve got
baseURL set to http.
Change that setting in config.yaml, rebuild on your local machine, push to github, and away you go.
Good lord!! Finally it’s working now!! Seems so simple yet I had a rather steep learning curve. But I’m happy I am able to take away something at least. Many many thanks to you for your continual help and support in getting this up and running!! I would also like to thank the community in general for extending their help.