I am trying out creating my own shortcodes. One thing that is however baffling me is that sometimes when I change a shortcode the change is not reflected in the live website.
I run “hugo server -D” and am currently at version 0.77
Situation:
I have two shortcodes.
wrap.html
{{ .Inner }}
And
photo.html
<figure itemprop="associatedMedia" itemscope itemtype="https://schema.org/ImageObject">
<a href="{{ .Get "href"}}" itemprop="contentUrl" data-size="{{ .Get "largeDim"}}" data-medium-url="{{ .Get "smallUrl" }}" data-medium-size="{{ .Get "smallDim" }}">
<img alt="{{ .Get "alt"}}" data-size="{{ .Get "thumbSize"}}" itemprop="thumbnail" src="{{ .Get "thumbUrl"}}">
</a>
<figcaption itemprop="caption description">
{{ .Get "caption"}}
{{ if (not (eq (.Get "copyright") "")) }}
<span itemprop="copyrightHolder">© {{ .Get "copyright"}} all rights reserved</span>
{{ end }}
</figcaption>
</figure>
And a md page that contains something like this:
{{< wrap >}}
{{< photo href="/images/Drone_Pictures/large/20201009_132117_1600x1199.jpg" largeDim="1600x1199" smallUrl="/images/Drone_Pictures/small/20201009_132117_800x600.jpg" smallDim="800x600" alt="None" thumbSize="256x256" thumbUrl="/images/Drone_Pictures/thumb/20201009_132117_256x256.jpg" caption="" copyright="KvB 2020" >}}
{{< photo href="/images/Drone_Pictures/large/20201009_132125_1600x1199.jpg" largeDim="1600x1199" smallUrl="/images/Drone_Pictures/small/20201009_132125_800x600.jpg" smallDim="800x600" alt="None" thumbSize="256x256" thumbUrl="/images/Drone_Pictures/thumb/20201009_132125_256x256.jpg" caption="" copyright="KvB 2020" >}}
{{< /wrap >}}
This is actually from HugoPhotoSwipe, which I found here: https://github.com/GjjvdBurg/HugoPhotoSwipe/wiki#gallery-configuration
I wanted to take this further and modify the shortcode to style the page the way I want. So I for example added something to the “wrap” shortcode and did see the page change.
But if I add something to the photo shortcode this does not get reflected in the rendered page, unless I stop and start the server.
Is this because the shortcode is nested, and thus does not get rendered?