preaction / Statocles

Static website CMS
http://preaction.me/statocles
Other
84 stars 33 forks source link

Create a generic site scratch / build / cache directory #528

Open preaction opened 7 years ago

preaction commented 7 years ago

Right now, a Statocles site has a build_store attribute, which is a path that we use to put the site as we build it. By default, this is .statocles/build, and this directory is the root of the built site. However, we now (with PR #527 and things like #498) have more reasons to have a directory to store built things in addition to the built site.

So, in order to do this in a manner that is painless to upgrade, we should add a work_dir attribute to the Site object. This attribute should default to .statocles, and be used to build the default for the build_store attribute (allowing users with an overridden build_store to keep doing so for the time being).

We should document this directory as the one place where Statocles will generate files during the build process, so it must be writable by the user running the statocles command.

Once we have the work_dir attribute, we should ensure that the status command uses it to store the status.yml file, and any other temporary files and such use this directory and not any other.

Eventually, we will remove the build_store attribute in favor of simply using $work_dir/build as the build directory. If you want, as part of this ticket, we should deprecate the build_store attribute to remove it in Statocles 2.0.