Common practice: content and images in VCS, or upload separately?

Context

I am working on a Zola-based website.
The contents will be provided by another person.
I am sure I could teach them to use basic git (via GUI) to add their markdown files and images to the repository and do the pull/edit/commit/push dance whenever they change something.

However, I am unsure if committing image files to git is such a great idea at all.

  1. I want to integrate the zola build step in my usual GitLab CI/CD pipelines. I worry that over time, the git repository might grow larger than necessary and CI build steps would pull down historical images which are no longer part of the current version of the website. This would slow down all workflows, and it would make pipelines run longer (which might cause the need to purchase (more) additional pipeline minutes).

  2. As an alternative, I could have the person editing the content - including images - upload their markdown and image files via sftp/rsync directly to the server. The zola build would need to happen there, and I would be unable to prove in advance in CI that the content is valid and can be built.

What is common practice here?

  • Do you Zola users add everything to git, including your image files?
  • Do you exchange older images for new ones every now and then (with the old ones remaining in VCS history) and has your repo size ever become an issue?
  • Do you prune-out outdated images by rewriting history?
  • Does shallow cloning help?

I appreciate your thoughts! :heart:

I normally add everything to git. Obviously that depends on the scale but I’m guessing most site images don’t change too much so there shouldn’t be too many changes in the history.

1 Like

I would deploy images in a separate repository and use it as a git module. This way, I could archive old assets by replacing the module or force-pushing new assets if env allows.

1 Like

Thanks for your response!

Would you keep the content md files in the same submodule?

I imagine this works well with colocated images.

Post images should stay with posts, so the content would remain usable. Backgrounds, logos, and other styling assets could be deployed in a separate module.

You could do the same with templates/macros/shortcodes so they could be reused in another project.

1 Like