Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

Media.yaml customisation for MD file

Started by T. 6 years ago · 3 replies · 674 views
6 years ago

Hi All,

As explain in Grav documentation, media.yaml, it is possible to add an extra mimetype to media.yaml file in Userfolder. But it seems to not work.

I would like to be able to list ".md" file as media files bu when I use the "page.media" function, it returns every type of file except ".md" files. So I tried to create my own "media.yaml' file in User and I've added an extra entry "md" which a copy-paste of the "TXT" mimetype.

Even with that it does not work as expected. I'm still not able to list "md" file as part for media files.

Am I doing something wrong ? Is it for security reason that ".md" file are not "browsable" ?

To stay simple, I just want the url of the current "md" file that Grav is displaying. Is there a simpler solution?

Thanks.

6 years ago

What do you get with page.media.all?

6 years ago

Thanks for the suggestion. Unfortunatly, it returns all a file except "md" files. Any other idea?

6 years ago

It might be .md files are treated special. They are page files after all. Sorry, don't know what to suggest

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by stuart young, 2 weeks ago
3 251 2 weeks ago
Themes & Styling · by Sebadamus, 3 weeks ago
5 317 3 weeks ago
Themes & Styling · by martynfoster735, 4 weeks ago
1 310 4 weeks ago
Themes & Styling · by Justin Young, 1 month ago
1 348 1 month ago
Themes & Styling · by Slebeig, 2 months ago
4 474 2 months ago