Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Media.yaml customisation for MD file

Started by T. 6 years ago · 3 replies · 834 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 MarkP, 2 weeks ago
3 193 2 weeks ago
Themes & Styling · by TomW, 2 weeks ago
0 111 2 weeks ago
Themes & Styling · by themetman, 3 weeks ago
1 206 3 weeks ago
Themes & Styling · by AH, 1 month ago
1 324 3 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1523 3 weeks ago