coronelcortez
coronelcortez

Reputation: 1

Docsy shortcode for tabs only working with html content and not markdown

According to Docsy documentation here

If your content is markdown, use the percent sign % as outermost delimiter of your tab shortcode, your markup should look like {{% tab %}}Your markdown content{{% /tab %}}. In case of HTML content, use square brackets <> as outermost delimiters: {{< tab >}}Your HTML content{{< /tab >}}.

As my tab content has markdown code that I need rendered, I'm using % as delimiter. But is not working, as it is rendering me the content as code block, which I understand is the default unless otherwise specified.

I tried:

{{% tabpane %}} {{% tab header="Tab 1 name" %}} markdown content for tab 1 {{% /tab %}} {{% tab header="tab 2 name" %}} Markdown content for tab 2 {{% /tab %}} {{% /tabpane %}} And it did not work: Using % as delimiter

So I tried HTML delimiter to check if delimiter parameter functionality was working at all and it kinda worked:

{{< tabpane >}} {{< tab header="Tab 1 name" >}} markdown content for tab 1 {{< /tab >}} {{< tab header="tab 2 name" >}} Markdown content for tab 2 {{< /tab >}} {{< /tabpane >}}

Using HML delimiter

It renders the content as HTML! So the feature seems to be working, just not for markdown content. This is my code: My code on VSC

I'm using VSC, and previewing changes on localhost with Hugo. I would be really thankful if someone could help me figure out what is happening here, that is, what I'm doing wrong. Thank you!

EDIT:

Specifying

lang="markdown"

in tabpane seems to helpe, butnot quite, as it renders markdown, but it still shows de special characters used in markdown (e.g. the ** to get bold letters) For bash it works, as long as bash command is the only content of tab. Once you add text before or after command it breaks.

Upvotes: 0

Views: 484

Answers (1)

NothingToSeeHere
NothingToSeeHere

Reputation: 127

I also had trouble with those. We started from what was the current hugo/docsy pair. We weren't able to make the tabs from hugo/docsy set work so I took the tab/tabpane set from Kubernetes' docs implementation. It works well enough to show other html. markdown, and other shortcodes on the tab panels.

Hugo and it's themes are not a "matched" system. Themes should only control a site's look and feel, but someone foolishly decided to stuff functionality into them, as well. Feel free to explore shortcodes from other themes until you hit the one that works.

Hugo and the themes are a meatball way to generate html. If you need to write real docs, IMHO, you're better off finding a real html site generation tool. Hugo is an awkward tool that's designed for bloggers, despite what Hugo supporter will say. Look at how much time you're wasting trying to make it perform its basic functions.

Hugo is blindlingly fast at generating websites, but that's all it has going for it.

Upvotes: 1

Related Questions