Hugo shortcode templates: Reading infos from markdown

Hello,

I want to change the theme I am using to to style images via css. I want to have images that resize when clicked. I have no experience in theming and using the mainroad theme. I have the css and html ready that should be produced from markdown.

Since I am too new to post images here, I cannot post my sample code here. So I posted it on dpaste:

Your best bet to generate the HTML you need is Hugo shortcodes

I think I might need hugo shortcode templates.

How do get the filename and the path out of a .Get?

[desc-02](file:///path/to/02.jpg)

I want to have these informations in variables that my shortcode can work on:

description: desc-02
filepath: /path/to/02.jpg
index: 02