diff --git a/site/content/en/docs/drivers/vmware.md b/site/content/en/docs/drivers/vmware.md index 7351904e4e..81b2ba3010 100644 --- a/site/content/en/docs/drivers/vmware.md +++ b/site/content/en/docs/drivers/vmware.md @@ -10,15 +10,15 @@ aliases: The vmware driver supports virtualization across all VMware based hypervisors. {{% tabs %}} -{{% tab "macOS" %}} +{{% mactab %}} {{% readfile file="/docs/drivers/includes/vmware_macos_usage.inc" %}} -{{% /tab %}} -{{% tab "Linux" %}} +{{% /mactab %}} +{{% linuxtab %}} No documentation is available yet. -{{% /tab %}} -{{% tab "Windows" %}} +{{% /linuxtab %}} +{{% windowstab %}} No documentation is available yet. -{{% /tab %}} +{{% /windowstab %}} {{% /tabs %}} ## Issues diff --git a/site/content/en/docs/handbook/pushing.md b/site/content/en/docs/handbook/pushing.md index a7419a58b2..5a43517bdc 100644 --- a/site/content/en/docs/handbook/pushing.md +++ b/site/content/en/docs/handbook/pushing.md @@ -136,7 +136,7 @@ eval $(minikube podman-env) You should now be able to use podman client on the command line on your host machine talking to the podman service inside the minikube VM: {{% tabs %}} -{{% tab "Linux" %}} +{{% linuxtab %}} ```shell podman-remote help @@ -146,8 +146,8 @@ podman-remote help Note: On Linux the remote client is called "podman-remote", while the local program is called "podman". {{% /pageinfo %}} -{{% /tab %}} -{{% tab "macOS" %}} +{{% /linuxtab %}} +{{% mactab %}} ```shell podman help @@ -157,8 +157,8 @@ podman help Note: On macOS the remote client is called "podman", since there is no local "podman" program available. {{% /pageinfo %}} -{{% /tab %}} -{{% tab "Windows" %}} +{{% /mactab %}} +{{% windowstab %}} ```shell podman help @@ -168,7 +168,7 @@ podman help Note: On Windows the remote client is called "podman", since there is no local "podman" program available. {{% /pageinfo %}} -{{% /tab %}} +{{% /windowstab %}} {{% /tabs %}} diff --git a/site/content/en/docs/start/_index.md b/site/content/en/docs/start/_index.md index d3ede45804..b15b010c7b 100644 --- a/site/content/en/docs/start/_index.md +++ b/site/content/en/docs/start/_index.md @@ -22,7 +22,7 @@ All you need is Docker (or similarly compatible) container or a Virtual Machine

1Installation

{{% tabs %}} -{{% tab "Linux" %}} +{{% linuxtab %}} For Linux users, we provide 3 easy download options: @@ -47,8 +47,8 @@ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest sudo rpm -ivh minikube-latest.x86_64.rpm ``` -{{% /tab %}} -{{% tab "macOS" %}} +{{% /linuxtab %}} +{{% mactab %}} If the [Brew Package Manager](https://brew.sh/) installed: @@ -70,8 +70,8 @@ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin sudo install minikube-darwin-amd64 /usr/local/bin/minikube ``` -{{% /tab %}} -{{% tab "Windows" %}} +{{% /mactab %}} +{{% windowstab %}} If the [Chocolatey Package Manager](https://chocolatey.org/) is installed, use it to install minikube: @@ -81,7 +81,7 @@ choco install minikube Otherwise, download and run the [Windows installer](https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe) -{{% /tab %}} +{{% /windowstab %}} {{% /tabs %}}

2Start your cluster

diff --git a/site/layouts/shortcodes/linuxtab.html b/site/layouts/shortcodes/linuxtab.html new file mode 100644 index 0000000000..2e229e4949 --- /dev/null +++ b/site/layouts/shortcodes/linuxtab.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
diff --git a/site/layouts/shortcodes/mactab.html b/site/layouts/shortcodes/mactab.html new file mode 100644 index 0000000000..7e8d3c75eb --- /dev/null +++ b/site/layouts/shortcodes/mactab.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
diff --git a/site/layouts/shortcodes/windowstab.html b/site/layouts/shortcodes/windowstab.html new file mode 100644 index 0000000000..bb9e9a1ada --- /dev/null +++ b/site/layouts/shortcodes/windowstab.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
diff --git a/site/static/js/tabs.js b/site/static/js/tabs.js index 06ae6a5562..88800d84d0 100644 --- a/site/static/js/tabs.js +++ b/site/static/js/tabs.js @@ -2,18 +2,21 @@ function initTabs() { $('.tab-content').find('.tab-pane').each(function(idx, item) { var navTabs = $(this).closest('.code-tabs').find('.nav-tabs'), - title = $(this).attr('title'); - navTabs.append(''); + title = $(this).attr('title'), + os = $(this).attr('os'); + navTabs.append(''); }); - + $('.code-tabs ul.nav-tabs').each(function() { - $(this).find("li:first").addClass('active'); - }) - - $('.code-tabs .tab-content').each(function() { - $(this).find("div:first").addClass('active'); + let tabSelector = getTabSelector(this); + $(this).find('li'+tabSelector).addClass('active'); }); - + + $('.code-tabs .tab-content').each(function() { + let tabSelector = getTabSelector(this); + $(this).find('div'+tabSelector).addClass('active'); + }) + $('.nav-tabs a').click(function(e){ e.preventDefault(); var tab = $(this).parent(), @@ -25,3 +28,18 @@ function initTabs() { tabPane.addClass('active'); }); } + +const getTabSelector = currElement => { + let osSelector = '.'+getUserOS(); + let hasMatchingOSTab = $(currElement).find(osSelector).length; + return hasMatchingOSTab ? osSelector : ':first'; +} + +const getUserOS = () => { + let os = ['Linux', 'Mac', 'Windows']; + let userAgent = navigator.userAgent; + for (let currentOS of os) { + if (userAgent.indexOf(currentOS) !== -1) return currentOS; + } + return 'Linux'; +}