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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Media.yaml customisation for MD file

Started by T. 5 years ago · 3 replies · 549 views
5 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.

5 years ago

What do you get with page.media.all?

5 years ago

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

5 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 Pedro M, 2 months ago
4 195 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago