How may I update my public folder?

Hi ,
I m using the Toha template, everything is working well on my GitHub.
But right now , I don’t know how to update GitHubPages from my localhost.
Indeed , I m doing some correction on my site and I need to commit and push them on my GitHub Pages.
I read that public folder is automatically generated with Hugo but I noticed I couldn’t see my own update that I have done on data and static folder.
So how may I update my public folder in order to push them on my GitHub?
Best regards

Care to share your repository so that we can take a look? Unless it has sensitive info of course

Well the issue is not from GitHub because the web site works well .
I try to update the public folder in order to commit them on my GitHub.
When we modify the data folder or static folder adding some items, does public folder generate automatically ? if it’s not how may I update it ?

Being a static site generator, Hugo doesn’t update your project unless you tell it to. Each time you make a change, you have to generate the site again ( that is, run hugo ) and commit the changes.

Did that help?

So I have to delete all content from public , am I right ?

You can delete it or not, it’s up to you. Running hugo will overwrite all the files it needs to and leave the others untouched (at least by default).

ok i see, how may I setting that overwrite option ?
you know I use that tutorial to make my website :

I believe that hugo --cleanDestinationDir will delete the /public folder and generate it again from scratch. Read the docs on the hugo command for more flags and info.

Ok great , thanks for your help.
i gonna try that

Wait! I read the tutorial. You probably don’t want to delete public each time, because it contains files from your repository (public/.git).

well I just want to update only datas that I have modified or added like some criteras on website.
I tried that command line that you told me . it seems running but I need check if the push runs on GitHub.

1 Like

Finally it s running , that’s perfect. However I got an issue on redirection of pages.
I mean when you go to website without including index.html. website is showing a default pages not my customize page.

I suppose I have to find among all files where are located the pages redirection in order to define a rule on whether you go without including index.html , website have to redirect on your custom page.
i gonna looking that .

Thanks for your help :wink:

1 Like

You are welcome :+1: Feel free to open a new topic if you have any other issues.

To get an answer it’s very important to include your code (or a working example) so that we can precisely tell what’s happening and is easier to help you.


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