thanks @jmooring , once again for providing detailed quality example and sharing your knowledge.
I use the code like this now
{{ $titleFirst := split .Title " " | first 1 }}
{{ $titleLast := split .Title " " | last 1 }}
{{ index $titleFirst 0 }}<span class="text-indigo-500">
{{ index $titleLast 0 }}</span>
// and I get the desired html
<h1>"Company "<span class="text-indigo-500">name</span></h1>
thanks