I store my images in static/images/{name of post}/
. How can I get the name of the file from the shortcode? Here’s how I’d like to run the shortcode:
{{< image name="note-01.png" >}}
Then, the shortcode runs the following:
<img src="/images/{name of post}/note-01.png" />
ju52
2
every page object has a file attribute .File
{{.File.BaseFileName}}
should do the trick
Here’s the solution: {{- Page.File.TranslationBaseName -}}
system
Closed
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.