0

I have a nuxt blog with the following folder structure and want assets/images and content to belong in their own separate repo:

project
  - assets
     - css
     - *images*
  - *content*
  - components
  - middleware
  - layouts
  - pages

As required by nuxt-content, /content contains the site specific content, like markdown files that go in the about page and blog articles. I am placing article and page images inside /assets/images.

I currently exclude /assets/images and /content in .gitignore, but I don't know how to give them their own repo. There doesn't seem to be a clean way to have two .git files in parent directory 'project' and if I initialize a repo in /content it doesn't have access to /assets/images.

ddriver1
  • 723
  • 10
  • 18
  • why do you want to keep it in a separate repo? – Daniela C. Montenegro Jul 11 '20 at 16:28
  • Try [submodules](https://stackoverflow.com/questions/1811730/how-do-i-work-with-a-git-repository-within-another-repository). – Daniela C. Montenegro Jul 11 '20 at 16:34
  • won't work with submodules, because they need to have a common root, which they won't. A cardinal rule in git is that the root folder is sacred. You want to have content as a separate repo? Fine. Want to have assets/images as a separate repo? Fine. Want to have content and assets/images in the same repo? Give them a common root -> that would be project. You'll end up cloning [two repositories in the same root](https://stackoverflow.com/questions/8778796/two-different-git-repo-in-same-directory). – Daemon Painter Jul 11 '20 at 17:20

1 Answers1

0

You could put content and images in a subdirectory (say blog) and replace /content and /assets/images with symlinks to /blog/content and /blog/images.

Then manage the content of blog in a separate repo, and probably include it as a submodule in your nuxt repo.

LeGEC
  • 46,477
  • 5
  • 57
  • 104