stackbit / jamstackthemes

A list of themes and starters for JAMstack sites.
https://jamstackthemes.dev
MIT License
596 stars 287 forks source link

Reduce size of github repo (image assets are very large) #17

Closed oshliaer closed 4 years ago

oshliaer commented 5 years ago

You have to separate the repo between the site and content data.

$> ncdu ./

<
--- ./stackbithq/jamstackthemes ---
  231.5 MiB [##########] /.git
   81.5 MiB [###       ] /static
  968.0 KiB [          ] /themes
  928.0 KiB [          ] /content
  500.0 KiB [          ] /draft
   72.0 KiB [          ] /data
   12.0 KiB [          ] /archetypes
    4.0 KiB [          ]  README.md
    4.0 KiB [          ]  generate-github.js
    4.0 KiB [          ]  generate-thumbnails.js
    4.0 KiB [          ]  capture-screenshots.js
    4.0 KiB [          ]  LICENSE
    4.0 KiB [          ]  .gitignore
    4.0 KiB [          ]  config.toml
    4.0 KiB [          ]  package.json
    4.0 KiB [          ]  netlify.toml

 Total disk usage: 315.5 MiB  Apparent size: 312.1 MiB  Items: 1453 

I think a submodule will be fine.

JugglerX commented 5 years ago

Hey, what is the problem exactly? The repo size is too large?

oshliaer commented 5 years ago

Hi!

Thanks for the repo. It's a really helpful!

It seemed to me that it was too big for me to add a couple of text topics. Or is it not so?

I might be wrong. Just correct me.

JugglerX commented 5 years ago

Yeah we are going to need to investigate reducing the size. Maybe use git LFS or Netlify large media. I suppose submodules could also be a solution. But I want to avoid making the repo hard to work with. Lots of people don't understand submodules, and git LFS requires extra tooling. It needs to be as easy as fork, clone, commit without doing any advanced git stuff.

oshliaer commented 5 years ago

OK. There is my example how I store a hugo project

  1. The theme has its own repo/my fork with a my own green branch. Located in a separate directory. Outside the project.
  2. The hugo-site has has its own repo/my fork. I call this the project.
  3. The content folder has has its own repo/my fork. Often this is a branch of one large repository where only articles are stored. Located in a separate directory. Outside the project.

For your case it may be

  1. The theme and hugo-site are stackbithq/jamstackthemes-hugo-site
  2. The content folder is stackbithq/jamstackthemes. You can use this as a submodule by path jamstackthemes/content/theme/

Without a risk to lost something.