For a manual-like document I'm writing, I have the need to save two additional items together with each section. For this I have created a custom command that creates a subsection under the section and separates the two items with an \hfill :

\NewDocumentCommand{\customSectionWithMetadata}{m o o} {\section{#1}% \subsection{% \IfValueTF{#2}{#2}{}% \IfValueTF{#3}{% \hfill \ (#3)% }{}% } }

Additionally, I have also implemented this answer to hide the \hfill from the TOC. Now I don't want to have the text from the subsection displayed as an additional item, but rather appended to the section text, preferably smaller and in a slightly lighter color.

What I have right now:

What I am trying to achieve:

Please note that I don't necessarily need to have the alias and the metadata as a subsection; if there is a better way to save them and display them both in the TOC and under the section title, then I'd be more than glad to switch to that.

(pretty large) Minimal Working Example: