Skip to content

Commit

Permalink
fix: render changelog on website
Browse files Browse the repository at this point in the history
  • Loading branch information
Jabster28 committed Jul 14, 2020
1 parent b3dd17c commit 2a02307
Show file tree
Hide file tree
Showing 6 changed files with 296 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"devDependencies": {
"@quasar/app": "2.0.5",
"@quasar/icongenie": "2.3.0",
"@quasar/quasar-app-extension-qmarkdown": "^1.0.29",
"@types/fs-extra": "9.0.1",
"@types/node": "12.12.50",
"@types/yargs": "15.0.5",
Expand Down
6 changes: 6 additions & 0 deletions quasar.extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"@quasar/qmarkdown": {
"import_md": true,
"import_vmd": false
}
}
13 changes: 6 additions & 7 deletions src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ export default {
caption: 'Frequently asked questions',
icon: 'help',
link: '/faq'
},
{
title: 'Changelog',
caption: 'Look at new features and bugfixes',
icon: 'assignment',
link: '/changelog'
}
],
animeLinks: [
Expand Down Expand Up @@ -188,13 +194,6 @@ export default {
caption: 'Source code for this application',
icon: 'code',
link: 'https://github.com/Jabster28/mirai'
},
{
title: 'Changelog',
caption: 'Look at new features and bugfixes',
icon: 'assignment',
link:
'https://github.com/Jabster28/mirai/blob/master/CHANGELOG.md#changelog'
}
]
};
Expand Down
40 changes: 40 additions & 0 deletions src/pages/Changelog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<q-page class="row items-center justify-evenly">
<q-markdown :src="md" class="col-10"></q-markdown>
</q-page>
</template>

<script lang="ts">
import Vue from 'vue';
import axios from 'axios';
export default Vue.extend({
name: 'PageChangelog',
mounted() {
this.$q.loading.show({
delay: 400 // ms
});
document.title = 'Mirai Changelog';
axios
.get(
'https://raw.githubusercontent.com/Jabster28/mirai/master/CHANGELOG.md'
)
.then(res => {
this.$q.loading.hide();
this.md = res.data;
})
.catch(e => {
this.$q.loading.hide();
console.log(e);
this.$q.notify(
'Hmm, something went wrong. Try again in a few moments.'
);
});
},
data() {
return {
md: ''
};
}
});
</script>
5 changes: 5 additions & 0 deletions src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ const routes: RouteConfig[] = [
component: () => import('layouts/MainLayout.vue'),
children: [{ path: '', component: () => import('pages/SearchManga.vue') }]
},
{
path: '/changelog',
component: () => import('layouts/MainLayout.vue'),
children: [{ path: '', component: () => import('pages/Changelog.vue') }]
},

// Always leave this as last one,
// but you can also remove it
Expand Down
Loading

1 comment on commit 2a02307

@vercel
Copy link

@vercel vercel bot commented on 2a02307 Jul 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.