If you need Hugo to understand the export options, the go-org module needs to implement that i.e. it needs to parse the #+options: keyword. Try asking this question on that repo.
PS: This is supported if you export the Org file using ox-hugo – (related tests).
various other efforts including copying the actual code in the examples provided such as the link you provided and here:
led to the same thing. the h2 didn’t increment, but the h3 did.
not sure why other than the html coding hugo produces is too complex for this to work because of the id=“headline-X”?
<h2 id="headline-1">
Animal Rights
</h2>
i haven’t really experimented further with this though beyond the hugo produced html (using a seperate stylesheet as well as placing code into baseof.html).
i also realized that the css solution wouldn’t produce the TOC i wanted so i wrote a little script which autonumbers the headings much in the way that org-num-mode does. The script can also remove the headings, if i want to work further on the file and then renumber things again.
i’m including below in case it is of use to someone else:
#!/usr/bin/env zsh
# [un]numbers the headings
# usage: org-numberer.sh <FILE>.org [+-]
fn=$1 #filename
op=$2 #operation [+-] numbers
h=(0 0 0 0 0 0) #initialize heading array to depth of 6
case $op in
"+")
echo "adding numbering ..."
while read l
do
itm=${l%% *} #isolate the itm before the first space
len=${#itm} #get length of the itm
txt=${l#* } #isolate the text following *
if [[ $itm =~ ^\\* ]];
then #if itm begins with * it is a heading, so process numbering
(( h[len]++ ))
#build the section numbers sn
sn=''
for i in {1..$len};do
sn="$sn$h[i]."
done
sn=${sn%.}
h[i+1]=0
l="$itm $sn $txt"
fi
echo $l >> TMP #append line (heading or not)to TMP file
done < $fn
mv TMP $fn
;;
"-")
echo "removing numbering ..."
sed -i 's/^\(\**\) [0-9.]* /\1 /' $fn
;;
*)
echo "LIKE THIS: orgnum.sh <FILE>.org [+-]"
exit
esac
exit