Restore a hugo page

Hello, I accidently deleted all my hugo files and have only a copy of the generated HTML files which is running on a server.
Is there a way to restore the site based on the generated HTML files?

Thank you,

Generating a static site is one way process.

What a pity :frowning:
Thanks, anyway.

@Eddy_Bobb Terrily sorry to hear about that. Not trying to rub salt in your wound, but I would STRONGLY recommend putting your content and templating in Git and using a hosted solution to persist the content for you (probably Github, but gitlab, bitbucket, etc will work fine as well).

That said, tell me more about your site. How many pages? What OS are you developing on? If you’re a Mac user, there might be ways to consolidate your efforts, at least with respect to article content via tools like wget and Pandoc. Can you point me to the site itself?

Hello @rdwatters:

Never mind, the site is really simple:

I can rebuild it by myself, there are only two posts.

But you’re right, I need to put the project into git completely, not only the generated html :slightly_smiling:


@Eddy_Bobb, you don’t need to put your generated site into git, since that’s going to change all the time. Just commit the source files and put public into your .git-ignore file.

@RickCogley, I need to, because my hoster, openshift provides a auto- deployment mechanism based on a git repository :wink:

You can keep your source files in a repository, ignore your generated files (the dist directory you’re running a dev server from), then run a deploy command to publish only your generated files.

Look around for something like this: Git Directory Deploy