Problem with site on github

when i tried to load my site on github pages everything does not work in it when open, when I try to download from localhost everything is fine, but not public

GitHub - anyatomik/AstraLearn: site for astra-learn project - my site on github

Astra-learn - my site (There should be content here and it should be normal to go to pages and change language, but there’s nothing here)

I can’t even imagine how to solve this and why is this happening

two problems:

  • you commit your public folder to the repo, If building in a Ci/CD (gitub workflow) it’s not agood idea as the content is generated by the workflow and old stuff is not automatically deleted.

    remove the public folder and add it to your .gitignore file to never commit that automatically.

    git rm public
    git commit -m "removed public"
    echo "public/" >> .gitignore
    git push
    
  • you are building with a standard Github pages action workflow that uses Jekyll under the hood

    set up your workflow according to: Host on GitHub Pages

1 Like

when i tryed to commit hugo.yaml i had an error

HUGO_VERSION: 0.146.5
HUGO_ENVIRONMENT: production
TZ: America/Los_Angeles
GITHUB_PAGES: true
INPUT_PATH: ./public
Archive artifact
tar: public: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Error: Process completed with exit code 2.

the old workflow is atill there and active

how could i deactivate it?

there should be an option on your GitHub Actioon settings

sometimes its necessary to unpublish the site in the Github UI and then reactivate it

i just cloned your repo and get the same error with the workflow. … investigating

You have that in your hugo.toml:

publishDir = "docs"

so change your WF to use ./docs one instead of ./public

if you do not have something after that needs thet docs, I would recommend to just go with the defaults and remove that setting

just commented that line and all went fine

supose you now also want to remove the docs folder from your repo

Thank you so much! :grin:
The error really disappeared, but for some reason there is still no content on the main page, and the pages are inaccessible

mmh, maybe related to files organization with the theme.

i was able to get about page in en and ru.

your _index files in content root are in fact empty…

this also should be the case in local development.

build problem solved

i would consider that a new topic in case you cannot get it to work.

1 Like

Thanks again. But since the content _index is empty, how then does the site run through the hugo server?

ok. not empty at all but no content. They contain a frontmatter header. enough to be a valid page.

would be better to set post 2 as solution…the rest is lets call it noise :wink:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.