Bios-Marcel / stasi-blog

Generating static simple blogs (Podcasts?!) with an RSS feed
4 stars 1 forks source link

Improve output folder cleanup #2

Open Bios-Marcel opened 3 years ago

Bios-Marcel commented 3 years ago

Currently all files manually added to the output subfolders files will be deleted. Files manually placed directly in the output folder will be preserved.

To solve this, we need an index file. For example, if stasi generates the following folder structure:

|--articles
   |--article-1.html
|--favicon.ico
|--index.html

The generation index would look like this:

articles/article-1.html
index.html
favicon.ico

We'd then delete only the files, but not the folders and afterwards generate a new index. The index should be deleted last, to avoid leaving behind garbage in case of failures.