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

Custom directory listing #346

Closed
vvscode opened this issue Oct 28, 2020 · 12 comments
Closed

Custom directory listing #346

vvscode opened this issue Oct 28, 2020 · 12 comments

Comments

@vvscode
Copy link
Contributor

vvscode commented Oct 28, 2020

As soon as it's possible to use front matter for files, it's nice to have an option, how to create listing HTML.

We can defined template (like default one ) but in fact it's not really customizable

Nice to have a chance to setup getListing module (file) to pass list of files inside and get HTML as a result

@vvscode
Copy link
Contributor Author

vvscode commented Oct 28, 2020

Or add support for some plugins, so it might be implemented with plugin

@vvscode
Copy link
Contributor Author

vvscode commented Nov 2, 2020

@webpro please, take a look =)

@webpro
Copy link
Owner

webpro commented Nov 28, 2020

I understand your issue (there's only pre-rendered HTML for list of files itself). We could add a list of file paths and file names, so you can create a custom Mustache template.

Would that work for you?

@webpro
Copy link
Owner

webpro commented Nov 28, 2020

I just went ahead and refactored the current template to do the same (what was I even thinking by pre-rendering HTML outside the template, lol).

So now in v4.2.0 there's a filePaths and fileNames array to use in a custom template. See the current template for an example.

@vvscode
Copy link
Contributor Author

vvscode commented Nov 28, 2020

actually, I was going to use frontmatter info from files (with title and description), so just filenames and paths is not enough for me

Do you see it useful?

@webpro
Copy link
Owner

webpro commented Nov 28, 2020

Right.. yes I definitely see value in this. You (or someone else) up to work on a PR for this?

@vvscode
Copy link
Contributor Author

vvscode commented Nov 29, 2020

I have it in the plan for the Christmas holidays =)

@vvscode
Copy link
Contributor Author

vvscode commented Nov 29, 2020

Or not that far =)

@webpro
Copy link
Owner

webpro commented Dec 6, 2020

Thanks again, @vvscode, a present for reveal-md users well in advance before Christmas :)

@webpro webpro closed this as completed Dec 6, 2020
@engeir
Copy link

engeir commented Feb 13, 2022

Is it also possible to reverse the order of the files listed?

Having the files saved as YYYY-MM-DD-title.md, and then reversing the order would place the most recent files at the top, which is a more reasonable behavior at least for me.

@vvscode
Copy link
Contributor Author

vvscode commented Feb 13, 2022

@engeir not at the moment, but you can patch the package with patch-package

@engeir
Copy link

engeir commented Feb 14, 2022

@vvscode Thanks, never heard about that before. Worked perfectly!

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