thien-do / memos-pub

Markdown Blogging, Without Setup or Signup
https://memos.pub
116 stars 21 forks source link

Hide _ and . folders #6

Closed jackblk closed 2 years ago

jackblk commented 2 years ago

E.g https://huytd.memos.pub/everyday/notes, _meta is empty and should not be shown?

thien-do commented 2 years ago

Yup, it should not be shown. But it's a little bit difficult as when loading the list of files and folders, we can't know whether a folder is empty or not without another load.

This could be because we are using REST api. Maybe switching to GraphQL could help us have this 🤔

huytd commented 2 years ago

Ideally, we should hide every folder starting with an underscore _ or a dot .. It's also a default behavior of static site generators like Jekyll.

thien-do commented 2 years ago

@huytd I actually filtered out _ and . folders at first. But then I removed _ because of https://github.com/ZeroX-DG/blog/tree/master/source/_posts (cc @ZeroX-DG )

Not sure if _ filtering should be default or not though...

ZeroX-DG commented 2 years ago

I think it's OK to make it a default. It's more likely that those folders are not related to the content. If they do, .memosrc is there for a reason :smile:

thien-do commented 2 years ago

@ZeroX-DG but then your blog won't work by default because they are under _post 😢

ZeroX-DG commented 2 years ago

yeah and I won't use memos for my blog since it's already running on hexo blog engine & displaying in the exact way that I intended. All I'm saying is if a person store their blog contents in a folder that start with _, it's likely that they use a blog engine, and won't be using memos.

thien-do commented 2 years ago

oh right, that makes sense 🤔 will include _ now. Technically empty folder will be much more difficult to handle

thien-do commented 2 years ago

ok I filtered out "_". Will close this issue :D For technically empty folder, please open another issue if you feel right, but would be harder to do https://github.com/thien-do/memos-pub/commit/44f80bcbd03ab90837d684be46ec9b69b7b0ba12