lightbox: advise to don't link to random image ids #451

This commit is contained in:
Sören Weber 2023-02-02 23:45:31 +01:00
parent 1383b7e6af
commit eee19034b8
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 2 additions and 4 deletions

View file

@ -24,8 +24,6 @@ This document shows you what's new in the latest release. For a detailed list of
This also changed the [lightbox effects]({{% relref "cont/markdown#lightbox" %}}) parameter from `featherlight=false` to `lightbox=false`. Nevertheless you don't need to change anything as the old name will be used as a fallback. This also changed the [lightbox effects]({{% relref "cont/markdown#lightbox" %}}) parameter from `featherlight=false` to `lightbox=false`. Nevertheless you don't need to change anything as the old name will be used as a fallback.
As a further advantage, the image inside the lightbox now has its own URL and is therefore linkable.
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} [GitHub releases](https://github.com/McShelby/hugo-theme-relearn/tags) are also now tagged for the main version (eg. `1.2.x`) and major version (eg. `1.x`) making it easier for you to pin the theme to a certain version. - {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} [GitHub releases](https://github.com/McShelby/hugo-theme-relearn/tags) are also now tagged for the main version (eg. `1.2.x`) and major version (eg. `1.x`) making it easier for you to pin the theme to a certain version.
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Translation for Czech. - {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Translation for Czech.

View file

@ -35,12 +35,12 @@
{{- end }} {{- end }}
{{- $id := partial "make-random-md5.hugo" }} {{- $id := partial "make-random-md5.hugo" }}
{{- if $lightbox }} {{- if $lightbox }}
<a href="#{{ $id }}"> <a href="#image-{{ $id }}">
{{- end }} {{- end }}
<img src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}{{ if len ($classes) }} class="{{ delimit $classes " " }}"{{ end }} style="height: {{ $height }}; width: {{ $width }};" loading="lazy"> <img src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}{{ if len ($classes) }} class="{{ delimit $classes " " }}"{{ end }} style="height: {{ $height }}; width: {{ $width }};" loading="lazy">
{{- if $lightbox }} {{- if $lightbox }}
</a> </a>
<a href="javascript:history.back();" class="lightbox" id="{{ $id }}"> <a href="javascript:history.back();" class="lightbox" id="image-{{ $id }}">
<img src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}loading="lazy"> <img src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}loading="lazy">
</a> </a>
{{- end }} {{- end }}