spatie / sheets

Store & retrieve your static content in plain text files
https://spatie.be/open-source
MIT License
273 stars 21 forks source link

FilesystemRepository does not behave like expected with SlugWithXyzParser #36

Closed Gummibeer closed 4 years ago

Gummibeer commented 5 years ago

My expectation by using SlugWithOrderParser or also SlugWithDateParser was that I still could do Sheets::get('home') and it will find 01.home.md. But I have to call Sheets::get('01.home') to get the corresponding content. This means that I have to pass the order/date in the URL and if I change the order or date of a sheet I have to add redirects for to do not loose page rating and show the right content for posted links somewhere else.

To don't add a BC my idea would be to add a new method to the FilesystemRepository - for example getBySlug() which could the Factory::$pathParser property to create a regex and list all files via files() or allFiles().

spatie-bot commented 4 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

Gummibeer commented 4 years ago

I would like to reopen this issue because I still have this problem.

sebastiandedeyne commented 4 years ago

I'd be okay with making a breaking change here to use your suggested behaviour in v2.

Gummibeer commented 4 years ago

Do you want to work on it? Or should I provide a PR?

sebastiandedeyne commented 4 years ago

PR would be welcome, but I'll take care of it if you don't feel like it :)

Gummibeer commented 4 years ago

I will work on it tomorrow.

spatie-bot commented 4 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.