Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Media.yaml customisation for MD file

Started by T. 6 years ago · 3 replies · 745 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 FrViPofm, 3 weeks ago
4 452 2 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 789 3 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 646 2 months ago
Themes & Styling · by Sebadamus, 2 months ago
5 666 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 630 2 months ago