Skip to content

Commit

Permalink
Updating <hint> shortcode to be compatible with Hugo v0.100+ (#153)
Browse files Browse the repository at this point in the history
* Updating <hint> shortcode to be compatible with Hugo v0.100+

* Adding aaronshim@ to the contributors as suggested
  • Loading branch information
aaronshim committed Jan 9, 2024
1 parent 7e98b29 commit ca0b2a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions content/docs/contributions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,35 @@ We use the [Hugo Book Theme](https://themes.gohugo.io/hugo-book/) with custom mo
We modified the default [Hints](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/hints/) used by the theme; the modified boxes are listed below:

{{< hint info >}}
This is an *Info* box for the `{{</* hint info */>}}` shortcode.
This is an *Info* box for the `{{</*/* hint info */*/>}}` shortcode.
{{< /hint >}}

{{< hint note >}}
This is a *Note* box for the `{{</* hint note */>}}` shortcode.
This is a *Note* box for the `{{</*/* hint note */*/>}}` shortcode.
{{< /hint >}}

{{< hint example >}}
This is an *Example* box for the `{{</* hint example */>}}` shortcode.
This is an *Example* box for the `{{</*/* hint example */*/>}}` shortcode.
{{< /hint >}}

{{< hint tip >}}
This is a *Tip* box for the `{{</* hint tip */>}}` shortcode.
This is a *Tip* box for the `{{</*/* hint tip */*/>}}` shortcode.
{{< /hint >}}

{{< hint important >}}
This is an *Important* box for the `{{</* hint important */>}}` shortcode.
This is an *Important* box for the `{{</*/* hint important */*/>}}` shortcode.
{{< /hint >}}

{{< hint warning >}}
This is a *Warning* box for the `{{</* hint warning */>}}` shortcode.
This is a *Warning* box for the `{{</*/* hint warning */*/>}}` shortcode.
{{< /hint >}}

### Original style
The original hint style can be used by adding a third parameter, `noTitle`, to the shortcode, e.g.:

{{< hint example noTitle>}}

`{{</* hint example noTitle */>}}`
`{{</*/* hint example noTitle */*/>}}`

{{< /hint >}}

Expand All @@ -88,7 +88,7 @@ We would like to thank the following users who [contributed](https://github.com/
[NDevTK](https://github.com/NDevTK), [1lastBr3ath](https://twitter.com/1lastBr3ath),
[Brasco](https://github.com/Brasco/), [rick.titor](https://github.com/riccardomerlano),
[Chris Fredrickson](https://github.com/cfredric/), [jub0bs](https://github.com/jub0bs),
[Zeyu (Zayne) Zhang](https://github.com/zeyu2001)
[Zeyu (Zayne) Zhang](https://github.com/zeyu2001), [Aaron Shim](https://github.com/aaronshim),

In addition, we would also like to acknowledge the users who [contributed](https://github.com/xsleaks/xsleaks/wiki/Browser-Side-Channels/_history) to the predecessor of the current XS-Leaks wiki:

Expand Down
4 changes: 2 additions & 2 deletions themes/book/layouts/shortcodes/hint.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<svg class="book-icon">
<use href="/svg/hint-icons.svg#{{- $replaced -}}-notice"></use>
</svg><span>{{ $replaced }}</span></p>
{{ .Inner | markdownify }}
{{ replace (replace (trim .Inner "\r\n" | .Page.RenderString) "*/&gt;" "&gt;") "&lt;/*" "&lt;" | safeHTML }}
</blockquote>
{{ else }}
<blockquote class="book-hint {{ .Get 0 }}">
{{ .Inner | markdownify }}
{{ replace (replace (trim .Inner "\r\n" | .Page.RenderString) "*/&gt;" "&gt;") "&lt;/*" "&lt;" | safeHTML }}
</blockquote>
{{ end }}

0 comments on commit ca0b2a9

Please sign in to comment.