Is it possible to extract data from JSON within Makrdown posts?

Off topic:

If I wouldn’t have started my “Hugo career” :wink: with the Bootstrap docs as blueprint (reason was: They don’t use a /themes/ theme) I wouldn’t know how this .inline thing works until today.

2 Likes

@GhsvsDe, please, can I ask one more question? Please, I beg you, sir for one more question!

I’m now learning Bootstrap documentation site here: GitHub - twbs/bootstrap: The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Especially the markdown file, that you send me above: https://raw.githubusercontent.com/twbs/bootstrap/v5.1.3/site/content/docs/versions.md

And everything there is clear for me, except one moment. In the markdown file they create {{< list-versions.inline >}}{{< /list-versions.inline >}} shortcode. And between them extract data from data files.

That’s exactly what I need for my product website. But I’m looking at their layouts/shortcodes folder. And there is no any file, called list-versions. So I can just call (naming) my shortcode whatever I want, and no need to create a specific file within the layouts/shortcodes directory, if my shortcode is inline within markdown?

.

Exactely. You don’t need an additional shortcode file.

The second part .inline is mandatory. You can use almost any identifier before the .inline part. The main thing is that it is used identically in the closing, last line.

And you can use the same, self-invented identifier several times in one and the same content file. Only rarely you have to be careful.

1 Like

I understand, thank you so much again! I think, the Hugo team should hire you for a forum)) I read the documentation before, and understand nothing because many things are just dismissed in docs. But anyway, Hugo is extremely powerful with those capabilities and able to make much more than just static sites. Thank you for this framework!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.