Github markdown flavor checkboxes

Hello.
I’m new to hugo, so i really don’t know how to do this.
I would like to render “checkboxes” on my pages.
Github allows this with

  • [ ] Item unchecked
  • [X] Item checked

What would be the easiest way to have this behavior in my Hugo markdown files ?

Another link : https://github.com/nghenglim/markdown-enhancer, but i’m totally unable to have this working with my theme / layout (“crisp”).

Have a look at the pull request below. It looks finished so far and with a bit of luck it will be merged and already part of the next release.

https://github.com/spf13/hugo/pull/2296

Nice find, exactly what i need, ty.

Do you know if hugo snapshot binaries (before releases) are automatically published somewhere in order to already try this new feature ?

Currently not. The team is rather small and the creation of snapshot builds would create a overhead that could be invested in other areas.

However, depending on your skill level / familiarity with Go, you could compile the latest version yourself. The master branch is usually stable. The documentation lists the necessary steps.

Note that the pull request that I linked above is currently not merged into the codebase. Therefore, your compiled version of Hugo want contain it either unless your merge it yourself too.

I think Homebrew on Mac provides something similar to “snapshots” for Hugo.

@digitalcraftsman, thanks for the pointers.

I can confirm that the pull request 2296, once merged and recompiled, works as expected (excepted that the “li” HTML dots are still displayed, they should in my opinion be removed when checkboxes are used - but it’s probably a matter of personal choice).

@bep Should we add list-style: none; as in-line CSS to remove the bullet points by default or should this be done by the themes?

This should be done by CSS classes not inline style. It would be tempting to add inline style in this particular case, but there will always be a person down the line asking how to get his list bullets back … And with a CSS class on both ul/ol and li we should be fairly user friendly.

… but I’m not married to that decission …

What we may do in the future, is to add a way to add some default CSS class definitions, somehow.