I have a Hugo based website hosted at Codeberg.
Recently I lost my local markdown source folder.
I restored source from previously backup’ed files, but it is 2 month ago version.
I would like to submit new posts via Git, but as far as i understand after my next submission all missing *.md files provoke deletion of august and july posts at Codeberg. Is there any way to prevent it and restore md source?
All i have is current correct public folder cloned from Codeberg repository.
Screen shot from local copy of blog:
As you can see it ends up at may posts.
My page:
Hi, as a first step, I’d recommend adding your source files to git, to avoid similar problems in the future.
As for the missing posts, I can think of two possibilities:
- you can convert the html files into md for example with pandoc, then clean them up manually
- if you don’t actually need the posts in markdown, you can try adding the raw htmls to your source files, as Hugo handles htmls as well. If the files linked from the htmls (css, images, and so on) are there where the file expects them, the posts should appear in the build AFAIK.
2 Likes
Thanks for comprehensive answer.
I’ll check pandoc utility for sure.
I need plain html, no need for markdown.
But backup of markdown source will be neat.
I’m not a git expert. How to add “markdown” folder to repository?
Could you provide example?