Removing dom ID requirement for margin/sidenotes ()

* Removing dom ID requirement for margin/sidenotes

Prior to this commit, when using the `marginnote` or `sidenote`
shortcodes, you would need to pass a domId parameter to the shortcode.

With this change you no longer need to pass a parameter, and any
parameter passed is ignored. The pre-amble creates a unique domID for
the shortcodes.

* Replacing convoluted Scratch with Ordinal

I was leveraging the Scratch function of Hugo, when I could instead
rely on `.Ordinal`
This commit is contained in:
Jeremy Friesen 2019-04-18 09:37:06 -07:00 committed by Shawn O'Hare
commit 4299d3bfdb
3 changed files with 20 additions and 22 deletions
layouts/shortcodes

View file

@ -1,3 +1,3 @@
<label for="{{ .Get "id" }}" class="margin-toggle sidenote-number"></label>
<input type="checkbox" id="{{ .Get "id" }}" class="margin-toggle"/>
<span class="sidenote">{{ .Inner }}</span>
{{ $sidenoteDomIdSuffix := .Ordinal }}<label for="sidenote-{{.Page.UniqueID}}-{{ $sidenoteDomIdSuffix }}" class="margin-toggle sidenote-number"></label>
<input type="checkbox" id="sidenote-{{.Page.UniqueID}}-{{ $sidenoteDomIdSuffix }}" class="margin-toggle"/>
<span class="sidenote">{{ .Inner }}</span>