teamosis / gethugothemes-documentation

This is the documentation site for Gethugothemes. This is a premium template, Please do not use this template for your personal project. you can buy this template from https://gethugothemes.com/products/godocs
https://docs.gethugothemes.com
Other
6 stars 11 forks source link

Add code-switcher #7

Closed davidsneighbour closed 3 years ago

davidsneighbour commented 4 years ago

Add the code switcher that the Hugo docs are using to show code for all three configuration languages (toml, yaml, json) and JS to keep the selection consistent across all pages.

https://github.com/gohugoio/gohugoioTheme/blob/3077c41231a29937304e9a9cf905c4bab968a7c9/layouts/shortcodes/code-toggle.html#L1

https://github.com/gohugoio/gohugoioTheme/blob/master/assets/js/codeblocks.js#L1

https://github.com/gohugoio/gohugoioTheme/blob/master/assets/js/tabs.js#L1

davidsneighbour commented 3 years ago

I documented the shortcodes tabs and tab and tested it on the i18n-pages. Looks good and we don't need additional plugins and javascripts and stylesheets to implement that. It can be done via tabs with .toml/.yaml/.json in the tab titles and code fences inside the tabs.