The Hugo-only feature seems to be available only for few set of attributes – I only tested this for this post. So the following doesn’t work:
Sample 4:
Some paragraph. The quick brown fox jumps over the lazy dog.
{property="name"}
Sample 5:
* List 1
* List 2
- List 3
* List 4
{property="name"}
Edit files in the /layouts/ directory
Another way is, assuming you want the RDFA applied to all content (not just for a particular post) is by editing the layout files in your /layouts/ directory.
Notes
If you use the built-in Goldmark feature and the Hugo-only feature, you can only add to HTML elements that is produced by Markdown, which are the content files.
If you want to add RDFA attributes to elements not part of content but is generated from frontmatter, you need to edit the files in the /layouts/ directory. For example, the title of the content is always part of /layouts/_default/single.html file (or another file depending on how the theme developer split it up), usually something like <h1>{{ .Title }}</h1> so you’ll need to edit this file and make it <h1 property="name">{{ .Title }}</h1>
Extra: Semantic Web for Hugo
If you are adding RDFA for semantic web purposes, there is also Semantic Web for Hugo, however, it uses JSON-LD instead of RDFA. Personally, it’s easier to use JSON-LD than RDFA because we don’t have to edit theme files.
Thanks for the detailed reply! Appreciate it mate.
Yes! I can make it work with the JSON-LD using the type params with the templates… Pulling data from front matter.
Thought of using the RDF implemented too.
With the help of @davidsneighbour I’m able to setup the property value to the headers. Thanks @davidsneighbour for it. But but… can’t able to make it work for the paragraph and lists… Like you mentioned.
I did worked at the layout level too and added the breadcrumbs using RDFA.