Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media location for a folder per post #29

Open
itstamimi opened this issue Feb 27, 2024 · 3 comments
Open

Media location for a folder per post #29

itstamimi opened this issue Feb 27, 2024 · 3 comments

Comments

@itstamimi
Copy link

itstamimi commented Feb 27, 2024

What's the configuration for a setup like this? All what I have tried so far didn't work and keeps assuming I have one folder for ALL my media, which is very chaotic.

Folder structure is simply like this

content/
     posts/
          post1/
                index.md
                image1.png
          post2/
                index.md
                image1.png
          post3/
                index.md
                image1.png
@itstamimi itstamimi changed the title Media location where one folder post Media location for a folder per post Feb 28, 2024
@nhoizey
Copy link

nhoizey commented Mar 16, 2024

I second this.

I really prefer keeping assets (images mostly, but sometimes other file types) in the same place as the text content using them.

@nhoizey
Copy link

nhoizey commented Mar 16, 2024

I think this is related to what's been asked in another issue:

@hunvreus
Copy link
Member

hunvreus commented Mar 30, 2024

I think to enable this I would probably need to do 2 things:

  1. Enable saving posts in a subfolder, meaning that rather than saving an entry as posts/my-entry.md I would save it as posts/my-entry/index.md.
  2. For new content, force the user to save the entry before uploading any asset.

The issue with the first point is that this will likely require a lot more work as to retrieve all the entries in a collection I'll need to run an individual query to the GitHub API for each entry as I don't think I can recursively fetch files with the GitHub GraphQL API. To make it manageable, I'll likely need to aggressively cache entries. That's probably more of a 1.0.0 feature to be honest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants