Hugo tips

HTML <details>#

Depuis la v0.140.0 de hugo, un raccourci natif existe pour <details>. Comme certains thèmes comme hugo-book le définissent de façon plus ou moins efficace, on peut le surcharger en copiant l’implémentation native dans layout/_shortcodes/ :

Details
frv@cavalas:~/ws/frv.frama.io$ wget https://raw.githubusercontent.com/gohugoio/hugo/refs/heads/master/tpl/tplimpl/embedded/templates/_shortcodes/details.html -O layouts/_shortcodes/details.html 

renderer.unsafe#

Certains raccourcis générent du code HTML avant le rendu goldmark donc omis dans la page finale avec un avertissement :

WARN  Raw HTML omitted while rendering "/home/frv/ws/frv.frama.io/content/maths/terminale-spe/suite-arithmetico-geometriques.md"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe

Il faut donc autoriser explicitement le rendu HTML par

[markup.goldmark.renderer]
      unsafe = true`

mais on ne peut pas le faire par page, il faut le mettre dans la configuration du site (hugo.toml).

hugo admonitions#

Ceci est une citation normale sans tip

(https://gohugo.io/render-hooks/blockquotes/)

💡 TIP

{{:bulb:}} Avec la syntaxe de base

⚠️ WARNING

Cette syntaxe n’est pas compatible avec GitHub !#

mais devrait être repliable

❗ CAUTION

Do not approach or handle without protective gear.

✔️ NOTE

Do not approach or handle without protective gear.

ℹ️ IMPORTANT

Do not approach or handle without protective gear.