I have been struggling to figure out how to properly indent a block of code (with language) when inside a list and found the solution which I wanted to share.
The notation ```cpp only works when it starts at the first column and as a result it is not properly indented in the list. Instead you can use <highlight> shortcode like so (note the 4 spaces before <highlight>!):
* item 1
* item 2
{{< highlight cpp >}}
// my cpp code to hightlight
{{< / highlight >}}
which renders like this:
Now the code block is properly indented as part of the item 2 instead of being outside the list.