binyamin / eleventy-garden

:seedling: A starter site for building a mind garden with eleventy
https://eleventy-garden.netlify.app
MIT License
451 stars 48 forks source link

Separate content from config #79

Open asbjornb opened 2 years ago

asbjornb commented 2 years ago

Personally I'd love to have content separated as much as possible from code and configs.

Is your feature request related to a problem? Please describe. The issue with the current setup is it makes syncing updates to the template into my fork more painful/less clean than it needs to be.

Describe the solution you'd like Move notes, assets, about.md, index.md etc. into a content sub-directory. Then when merging one can disregard changes in this folder. It's not completely separable since notes.11tydata.js needs to live inside the notes folder unfortunately.

Describe alternatives you've considered Haven't thought of any.

Additional context I have a proposed solution made up in my own fork (commit) but looking for others to weigh in before I submit a PR. Maybe noone else is keeping their forks linked to upstream to pull updates? Maybe others have even better ways to structure their repo.

binyamin commented 2 years ago

I can see the problem you're identifying. I agree that this is important.

Two other solutions:

Store the contents externally

With my own site, I store the wiki contents in a separate repository. During the build process, I run a script which pulls the contents, and writes them to the correct folder before running Eleventy. This setup won't work for everyone, but it does separate the content from the notes.11tydata.js file.

Make this a Plugin

Possibly - and this is just a thought - this could become a plugin instead of a template repository. I don't know if it's possible to add computedData via a plugin. This would solve problems like https://github.com/binyamin/eleventy-garden/discussions/71#discussioncomment-2380371, where the website already exists and it's not feasible to rebuild it from a template.

asbjornb commented 2 years ago

Thanks for the quick feedback.

I already do your first solution for my notes - though a simpler pure delete and copy script that works on my filesystem with my current repo-folder-setup. I don't think that excludes my proposed change - having content a bit more separated makes that process easier.

Making it a plugin sounds like a great idea, but alas I don't think I could help much with that. I don't understand much js or 11ty.

Also I think this template still has value even if a plugin is made - this template let me know that there was indeed an easy way to publish interlinked notes even if I'll end up changing a few things. And it looks good and is very plug&play.

jebeaudoin commented 2 years ago

I'm a newbie, but could you use GitHub submodules for separating content from config?