Skip to content

Commit 9c2ad05

Browse files
authored
Adds query param for version no
This adds support for using a query parameter for selecting the version no
1 parent 5ac191d commit 9c2ad05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
<script>
8080
const RusfmtTagsUrl = 'https://api.github.com/repos/rust-lang/rustfmt/tags';
8181
const UrlHash = window.location.hash.replace(/^#/, '');
82+
const queryParams = new URLSearchParams(window.location.search);
83+
const versionNumber = null !== queryParams.get('version') ? 'v' + queryParams.get('version') : 'master';
8284
new Vue({
8385
el: '#app',
8486
data: {
@@ -87,7 +89,7 @@
8789
configurationDescriptions: [],
8890
searchCondition: UrlHash,
8991
shouldStable: false,
90-
version: 'master',
92+
version: versionNumber,
9193
oldVersion: undefined,
9294
versionOptions: ['master']
9395
},

0 commit comments

Comments
 (0)