Hugo runs locally, but fails to upload on github

I have been using Hugo for around 1,5 year now.
Today, I did two large commits and although they were uploaded normally, they did not appear on my site but rather a white page appeared with my name.

I tried renaming the directories and pushed again, and was met with the same issue (maybe I should have waited for github to render the site).

I then tried to revert back to a previous version of my site, but then started the push commits to fail. Now, I only see a failed push on my actions page with an exit code 1. The site runs perfectly on localhost though.

I tried using webtools to see if there is any error but nothing. I tried a bunch of git shenanigans but nothing worked. I am out of ideas and it is a pretty big blog to rebuild it from scratch.

The files can be found here: GitHub - connar/connar.github.io

Change Hugo version to 0.146.0 or later connar.github.io/.github/workflows/hugo.yaml at main · connar/connar.github.io · GitHub
In fact, use the latest workflow Host on GitHub Pages

I see, thank you very much!
Now that the commits worked, I only see my name again on the page, even though I was not met with any errors. Should I wait for github to render the page or is there any issue still?

View you live home page, then view source (typically Ctrl + U) in your browser. On line 8 you’ll see this:

<!-- Begin Jekyll SEO tag v2.8.0 -->

You are building your Hugo site with Jekyll.

Follow the Hugo documentation for hosting on GitHub Pages. Specifically, check steps 3 and 4:
https://gohugo.io/host-and-deploy/host-on-github-pages/#step-3

Additionally, don’t check your public directory or .hugo_build.lock into source control. To fix:

git rm -rf public/
git rm .hugo_build.lock
touch .gitignore

Then paste this into the .gitignore file you just created:

.hugo_build.lock
node_modules/
public/
resources/

Then:

git add -A
git commit -m "Fix repo"
git push

Thank you very much, the site is back on running!

Only question I have left is that, for some reason css got messed up. For example the backtick code blocks (code) do not work properly. You can see examples of it in the following two posts:

Should I specify some parameter in the toml file for that or write custom css? (and in what file should custom css be placed).

Thanks again everyone:)

Apparently, your code is included as SVG. I have no idea why, but that is unusual. And no, it is not a code block. It is an svg graphics.

Yes I also checked that, and I as well have no clue why this happened. And the strangest thing is that some text inside the backticks (```) appear either extremely large or extremely small (as seen in the links I attached). So I am kinda lost on that matter myself.

It would help if you’d tell us what the sources for these HTML files are.

by sources, you mean the markdown code used to generate the html files?

If you generate your HTML from MD files – yes. If you generate it from other sources – well, these.

Change the Hugo version in your workflow file to v0.147.3.

There was a known issue in v0.146.0 and v0.146.1 related to fenced code blocks and GoAT diagrams.

Also, when creating a fenced code block you should always specify the code language in the info string. Use text if nothing else is applicable.

for the first post link where the text appears really big inside backticks, you can find the content here: connar.github.io/content/ctfwriteups/captcha4humans.md at main · connar/connar.github.io · GitHub

for the second post link where the text appears so small it seems like a line, you can find the content here: connar.github.io/content/posts/malicious_ppt1.md at main · connar/connar.github.io · GitHub

Also, if it is of any help, the .toml file can be found in the blob/main/hugo.toml (writing the url like this because the forum does not allow new users paste moer than 2 links)

Trying it right now and will edit this in a bit.

Edit: It worked! Thanks you hugo wizards for your help! Wish I could buy you a coffee.

Last question, for custom css, in which file should I append my code? I tried in the past but had no luck finding the correct file and ended up placing the custom css in each .md file separately.

Perhaps setting a language for the code would help, something like
```sh in the first case.

In the second case, I don’t see a problem here with the HTML. But perhaps I’m not looking in the right place.

That should be explained in the documentation of the theme you’re using.

mkdir -p assets/css/extended
touch assets/css/extended/foo.css

See https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#bundling-custom-css-with-themes-assets

You can! See Sponsor @bep on GitHub Sponsors · GitHub.