Bootstrap Tabs not Working #299
-
Hi, I'll preface this by saying I'm not a Frontend Dev so could be missing something, I've just been going over this for a couple of days now so thought it best to ask I'm using your theme which I'm really enjoying to rebuild our docs website in my personal space before pushing it to our org and so far so good, Something we're really keen to implement are tabbed codeblocks so you can get examples in different languages e.g. Python, JS, Go etc However no matter what I try to implement either pure bootstrap tabs or other people's shortcode for tabs it just doesn't work Specifically what happens is that the first tab and it's content render but then when you go to click the second tab all that happens is a new I've tried a few things:
Switching the js import of I've tried using the following short codes: I've also tried to implement pure html direct to the document with the same results which leads me to believe it's not the shortcode/html or hugo as a base but something in how the html either is being rendered or treat by doks specifically (otherwise there wouldn't be so many people with example shortcodes or having it work) My intuition is telling me it's to do with how when I click on a tab it treats it like I'm linking to a heading in the document and amending the url as a result but I am just guessing Could well be there's some magic JS I'm missing to make this all work Any insight or ideas on how to implement this would be greatly appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
I was right it was the links, but it wasn't Doks fault at all - the K8s shortcode uses for its data toggle where the Bootstrap docs recommend buttons I changed the references to buttons instead and it works now Posting the changes here for context: Before:
After:
@h-enk could you add the attached shortcodes and usage docs to the project? I'm sure this will go a long way to helping people wishing to do similar and use this site for documentation! They're a little rough so might need some refinement but hopefully this helps anyone else looking for this :) Shortcodes to be put in (Github won't let me upload html files) Example of usage (from the K8s site) |
Beta Was this translation helpful? Give feedback.
-
@leflambeur I've managed to get the tabs and the tab content rendering, but for whatever reason, Any ideas? |
Beta Was this translation helpful? Give feedback.
-
The solution for me to get tabs working: Here is the killer part I struggled with. Go open Thanks to @leflambeur for all the help. |
Beta Was this translation helpful? Give feedback.
I was right it was the links, but it wasn't Doks fault at all - the K8s shortcode uses for its data toggle where the Bootstrap docs recommend buttons
I changed the references to buttons instead and it works now
Posting the changes here for context:
Before: