@@ -8,29 +8,32 @@ <h2 id="quickStart">Quick Start</h2>
8
8
Alternatively, head over to our documentation to learn more about getting started with Java and MongoDB.
9
9
</ p >
10
10
11
- {{ range where $.Site.Data.releases.versions "version" $.Site.Data.releases.current }}{{ $.Scratch.Set "currentReleasedVersion" . }}{{end }}
12
- {{$currentReleasedVersion := $.Scratch.Get "currentReleasedVersion"}}
11
+ {{ range where $.Site.Data.releases.versions "version" $.Site.Data.releases.current }}{{ $.Scratch.Set "qs. currentReleasedVersion" . }}{{end }}
12
+ {{$currentReleasedVersion := $.Scratch.Get "qs. currentReleasedVersion"}}
13
13
14
14
< div id ="downloadWidget ">
15
15
< form class ="form-inline ">
16
16
< a id ="downloadLink " href ="https://oss.sonatype.org/content/repositories/releases/org/mongodb/mongodb-driver/{{$currentReleasedVersion.version}}/ "
17
17
class ="btn btn-large btn-dark btn-download " target ="_blank "> Download</ a >
18
- {{ $.Scratch.Set "pos" 0 }}
18
+ {{ $.Scratch.Set "qs.pos" 0 }}
19
+ {{ $.Scratch.Set "qs.firstDriver" false }}
19
20
{{ with $.Site.Data.releases.drivers }}
20
21
< select class ="driverPicker ">
21
22
{{ range . }}
22
- < option value ="{{$.Scratch.Get "pos "}}"> {{.name}}</ option >
23
- {{ $.Scratch.Add "pos" 1 }}
23
+ {{ if eq ($.Scratch.Get "qs.firstDriver") false }}{{ $.Scratch.Set "qs.firstDriver" . }}{{end}}
24
+ < option value ="{{$.Scratch.Get "qs.pos "}}" data-versions="{{.versions}} "> {{.name}}</ option >
25
+ {{ $.Scratch.Add "qs.pos" 1 }}
24
26
{{ end }}
25
27
</ select >
26
28
{{ end }}
27
29
28
- {{ $.Scratch.Set "pos" 0 }}
30
+ {{ $.Scratch.Set "qs.pos" 0 }}
31
+ {{ $firstDriver := $.Scratch.Get "qs.firstDriver"}}
29
32
{{ with $.Site.Data.releases.versions }}
30
33
< select class ="releasePicker ">
31
34
{{ range . }}
32
- < option value ="{{$.Scratch.Get "pos "}}"> {{.version}}</ option >
33
- {{ $.Scratch.Add "pos" 1 }}
35
+ < option value ="{{$.Scratch.Get "qs. pos "}}"{{ if eq (in .version $firstDriver.versions) false }}disabled=" disabled " {{end}} > {{.version}}</ option >
36
+ {{ $.Scratch.Add "qs. pos" 1 }}
34
37
{{ end }}
35
38
</ select >
36
39
{{ end }}
@@ -40,17 +43,20 @@ <h2 id="quickStart">Quick Start</h2>
40
43
< button class ="btn btn-dark "> < i class ="fa fa-clipboard fa-2 "> </ i > </ button >
41
44
</ div >
42
45
{{ $currentNode := . }}
46
+ {{ $.Scratch.Set "qs.firstDriver" true }}
43
47
{{ with $currentNode.Site.Data.releases.drivers }}
44
- {{ $.Scratch.Set "driverPos" 0 }}
48
+ {{ $.Scratch.Set "qs. driverPos" 0 }}
45
49
{{ range . }}
46
50
{{ $currentDriver := . }}
47
51
{{ with $.Site.Data.releases.versions }}
48
- {{ $.Scratch.Set "versionPos" 0 }}
52
+ {{ $.Scratch.Set "qs. versionPos" 0 }}
49
53
{{ range . }}
50
54
{{ $currentVersion := . }}
51
- {{ $driverPos := $.Scratch.Get "driverPos" }}
52
- {{ $versionPos := $.Scratch.Get "versionPos" }}
53
- < div id ="maven-{{$versionPos}}-{{$driverPos}} " class ="download {{if or (ne $currentVersion $currentReleasedVersion) (ne $driverPos 0)}} hidden{{end}} ">
55
+ {{ $firstDriver := $.Scratch.Get "qs.firstDriver"}}
56
+ {{ $driverPos := $.Scratch.Get "qs.driverPos" }}
57
+ {{ $versionPos := $.Scratch.Get "qs.versionPos" }}
58
+ {{ if in $currentDriver.versions $currentVersion.version }}
59
+ < div id ="maven-{{$versionPos}}-{{$driverPos}} " class ="download {{if ne $firstDriver true}} hidden{{end}} ">
54
60
< pre > < code >
55
61
<dependencies>
56
62
<dependency>
@@ -70,14 +76,16 @@ <h2 id="quickStart">Quick Start</h2>
70
76
71
77
</ code > </ pre >
72
78
</ div >
73
- {{ $.Scratch.Add "versionPos" 1 }}
79
+ {{ $.Scratch.Set "qs.firstDriver" false }}
80
+ {{ $.Scratch.Add "qs.versionPos" 1 }}
74
81
{{ end }}
75
82
{{ end }}
76
- {{ $driverPos := $.Scratch.Get "driverPos" }}
83
+ {{ end }}
84
+ {{ $driverPos := $.Scratch.Get "qs.driverPos" }}
77
85
< div id ="driver-{{$driverPos}} " class ="download description{{if ne $driverPos 0}} hidden{{end}} ">
78
- {{$currentDriver.description}}
86
+ {{$currentDriver.description | markdownify }}
79
87
</ div >
80
- {{ $.Scratch.Add "driverPos" 1 }}
88
+ {{ $.Scratch.Add "qs. driverPos" 1 }}
81
89
{{ end }}
82
90
{{ end }}
83
91
</ div >
0 commit comments