Skip to content

Commit

Permalink
make sure web page renders acceptable result when JS is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dinever committed May 18, 2021
1 parent 120925e commit d29d0a8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion site/content/en/docs/start/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ All you need is Docker (or similarly compatible) container or a Virtual Machine

{{% card %}}

Click on the buttons that describe your target platform:
Click on the buttons that describe your target platform. For other architectures, see [the release page](https://github.com/kubernetes/minikube/releases/latest) for a complete list of minikube binaries.

{{% quiz_row base="" name="Operating system" %}}
{{% quiz_button option="Linux" %}} {{% quiz_button option="macOS" %}} {{% quiz_button option="Windows" %}}
Expand Down
11 changes: 9 additions & 2 deletions site/layouts/shortcodes/quiz_instruction.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<div data-quiz-id="{{ with .Get "id"}}{{.}}{{end}}" class="quiz-instruction hide">
<p>Installation instructions:</p>
{{ $id := .Get "id" }}
{{ $selected := split $id "/" }}

{{ $os := index $selected 1 }}
{{ $arch := index $selected 2 }}
{{ $installer := index $selected 3 }}

<div data-quiz-id="{{ with .Get "id"}}{{.}}{{end}}" class="quiz-instruction">
<p>To install minikube on <b>{{ $arch }}</b> <b>{{ $os }}</b> using <b>{{ replace $installer "Binary" "binary" }}</b>:</p>
{{ .Inner }}
</div>
8 changes: 1 addition & 7 deletions site/layouts/shortcodes/quiz_row.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{{ $level := .Get "base" | strings.Count "/" }}

{{ $hide := "" }}
{{ if gt $level 0 }}
{{/* Initially we only show the top-level options */}}
{{ $hide = "hide" }}
{{ end }}

<div data-quiz-id="{{ .Get "base" }}" data-level="{{ $level }}" class="row option-row {{ $hide }}">
<div data-quiz-id="{{ .Get "base" }}" data-level="{{ $level }}" class="row option-row hide">
<div class="col-lg-2 my-auto">
<p>{{ with .Get "name"}}{{.}}{{end}}</p>
</div>
Expand Down
2 changes: 2 additions & 0 deletions site/static/js/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ function initQuiz() {
});
let userOS = getUserOS();
if (userOS === 'Mac') {
// use the name "macOS" to match the button
userOS = 'macOS';
}
$('.option-row[data-level=0]').removeClass('hide');
// auto-select the OS for user
const btn = $('.option-button[data-quiz-id=\'/' + userOS + '\']').first();
btn.addClass('active');
Expand Down

0 comments on commit d29d0a8

Please sign in to comment.