Added Updated default version to Rustfmt docs config

This commit is contained in:
gunadhya 2021-01-16 01:34:11 +05:30 committed by Caleb Cartwright
parent 3c36a0c0b7
commit 042c2ec369

View file

@ -87,6 +87,7 @@
</div>
<script>
const RusfmtTagsUrl = 'https://api.github.com/repos/rust-lang/rustfmt/tags';
const RustfmtLatestUrl = 'https://api.github.com/repos/rust-lang/rustfmt/releases/latest';
const UrlHash = window.location.hash.replace(/^#/, '');
const queryParams = new URLSearchParams(window.location.search);
const searchParam = queryParams.get('search');
@ -112,6 +113,16 @@
scrolledOnce: false,
},
asyncComputed: {
async updateVersion() {
let latest;
try {
latest = (await axios.get(RustfmtLatestUrl)).data;
} catch(err) {
console.log(err);
return;
}
this.version = latest.name;
},
async outputHtml() {
if (this.version !== this.oldVersion) {
const ConfigurationMdUrl =