Hugo site starts locally, only displays 404 on hosted GH page - github-pages

My Hugo site starts locally, but only returns a 404.html page when hit on GitHub Pages.
I've tried re-instantiating the repo, rebuilding the site with different commands, pushing and deploying with the Hugo deploy script, and rm -rf the public folder and re-adding it.
Repository: https://github.com/jschalz/jschalz.github.io
When following the tutorial, running git submodule add -b master git#github.com:jschalz/jschalz.github.io.git public:
'public' already exists in the index
Currently hosted at https://jschalz.github.io.
I'd expect the site to come up with my pages (and I definitely have non-draft pages on there), but it's only returning 404.html. It's possible it's because I renamed the repo at one point, but I'm not sure. Troubleshooting ideas are very appreciated.
UPDATE: The issue was that I didn't have an index.html, index.xml, or README.md in my repo. Fixed.

2022: A different approach uses now GitHub Actions, since those are the default to build GitHub pages, since Aug. 2022.
Hence the new section "Build Hugo With GitHub Action" and the GitHub actions/hugo-setup.
Original answer 2019:
The issue was that I didn't have an index.html, index.xml, or README.md in my repo. Fixed.
Not exactly fixed.
The point of the tutorial was:
git submodule add -b master git#github.com:<USERNAME>/<USERNAME>.github.io.git public
This creates a git submodule.
Now when you run the hugo command to build your site to public, the created public directory will have a different remote origin (i.e. hosted GitHub repository).
Meaning what you should be pushing if, from your public subfolder, only what Hugo has generated.
You should not push your Hugo project (config.toml, themes, and so on): those should be pushed in a separate GitHub repository for safekeeping and versionning.

Related

Getting a 304 response from newly created github page

I created a github page with jeyll as per https://docs.github.com/en/free-pro-team#latest/github/working-with-github-pages/getting-started-with-github-pages
This is my public repo https://github.com/MrBuggySan/mrbuggysan.github.io & this is the github page link https://mrbuggysan.github.io/
I've setup the github-pages dependency on the gemfile and this same repo works for me locally. Is there something I missed here?
First, make sure you have configured the main branch, folder docs, as publishing shource
Second, in that docs folder, you should see what Jekyll has generated: docs the "destination" folder in Jekyll configuration.
(like Jekyll itself does when it builds its documentation)

GitHub Pages repo is not loading work, what did I mess up?

I created a todo app and had it using GitHub Pages. It does not pull anything other than the readme.md when clicking the live link. I do not understand what I messed up here. I have a different repo using same style of programming that is working fine.
Issue repo: https://github.com/jsfilas/todo-app
Similar working repo: https://github.com/jsfilas/Restaurant-Page
Restaurant-Page is deployed to a gh-pages branch. There does not appear to be a gh-pages branch for todo-app. You have to put your dist folder on an orphan branch called gh-pages to deploy a static site.
https://github.com/jsfilas/Restaurant-Page/tree/gh-pages This is what GitHub is looking at for your Restaurant-Page.
Another way to deploy GitHub pages is to name your /dist folder /docs and update your GitHub pages settings to look at the /docs folder.

I deploy project on GITHUB pages not appear on browser

I deploy an angular project on GitHub successfully but when I click on the link of the project documentation appear instead of project How can I open the project on browser. the link of the project is https://khaledelmasry247.github.io/myNote/
This is Jekyll that runs by default on GitHub Pages.
You can disable it by adding the file .nojekyll in the root of your project.
More here:
https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/
I have faced the similar issue long back with my repository. You can check these steps:
navigate to repository
Go to settings of your repository
In the options section, navgate to github pages.
In the source select "root" as shown below.
Then check it once.
In order for GitHub pages to work with your project, you will need to build the angular project and push the built artifacts to your repository. You will also need to tell GitHub which directory to look at for your built files. It will look for index.html by default. Looking at your repo, it looks like you have already built your project and the files are in your gh-pages branch. You will need to do something like #KushalSeth suggests, except in your instance, you will have to change it to look at the gh-pages branch.
Click on the Settings for your project.
Scroll down to the GitHub Pages section.
Change the branch to your gh-pages branch.
Save.

GitHub repository created but unable to upload VS solution

I tried uploading a C++ project from Visual Studio 2019 onto my GitHub account.
The repository gets created when I do this however, none of my codes gets uploaded onto the repository.
Only the files ".gitattributes" and ".gitignore" appear in my repository.
Please could I have any suggestions on what I could do to fix this.
Close VS
Go to your local repository folder (the solution folder)
This will add all the files and commit them
git add .
git commit -m 'added files'
alternatively you can use "git add ___" to add one file at a time
Make sure you commit the changes and then do
"git push"
Re-open VS and everything should be setup now.
Here are some other instructions I wrote down recently which you may find helpful:
How to create a git repo from an ungitted local project already in development:
Create a empty repo on your repo hosting site
Go to your local project folder in git command line
git init
git add .
git commit -m 'message'
git remote add origin https://yourreposite.com/username/repo
git push -u origin master
Now you can open it in Visual Studio and everything is all setup

Deploy Django App on Azure: only displays default app, even after deployment

I am trying to deploy a webapp to Azure. I am following these directions https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-create-deploy-django-app/
First step, I created a webapp (Django) on the portal.
Then it says to follow the directions to configure Continuous deployment using GIT in Azure App Service. This should apparently lead to my having a local directory of Django files. https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
So I follow those directions, installing Git, creating a local repository, adding a webpage, enabling web app repository, deploying.
The webportal now shows that I have deployed ('active' deployment). However, when I go to the web app url, what's showing is NOT what I deployed, but rather what I guess is the default Django app with its urls (login, logout, contacts).
So then I create an actual Django app in my local directory (instead of the static index.html from the directions). I commit and push it to Azure. It shows as being deployed.
The result is the same as before: the default web app is showing.
So what I'm missing is the connection between my local repository and what's actually showing. Is there some way to pull the Azure default app into my local repository? (Once it's there, I'll be able to change it as I see fit.)
Things are working as expected, but you ended up overwriting the Django app in your first the Git commit. The Continuous Deployment instructions as written are generic to any deployment, even a blank Web App.
So what I'm missing is the connection between my local repository and what's actually showing. Is there some way to pull the Azure default app into my local repository? (Once it's there, I'll be able to change it as I see fit.)
All you need to do is git clone your repo after you've initialized your local Git repo on the Azure Web App. You've already gone through most of these steps, but I'll include them here for others who may be looking for this answer.
After you create the Django Web App from the Azure Marketplace/Gallery, scroll down to set up continuous deployment.
Choose Local Git repo.
Notice that you now have a Git Clone URL in both your Quickstart Essentials info and under All Settings >> Properties. Go ahead and copy this URL.
If you haven't already done so, you may need to set or reset your Deployment Credentials. You'll find this under All Settings. This will be your Git & FTP credentials. Note that this is actually the credentials for your Microsoft Account, not just this one Web App.
You already have Git installed from your first attempt. You should now be able to navigate to the folder you want to clone the repo into and run:
git clone <your_git_clone_url>
After you type in your password, you'll have a cloned repo of the Django Web App on your local system. cd into the directory and start working from there. Once you have changes, git add ., git commit, and git push them back to the repo in Azure to see your changes there.