Skip to content

Commit

Permalink
feat: add Umami support (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokaiser committed Feb 13, 2024
1 parent 927be59 commit b49dc60
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 6 deletions.
93 changes: 90 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
"@tonaljs/scale": "^4.12.5",
"petite-vue-i18n": "^9.9.1",
"pinia": "^2.1.7",
"vue": "^3.4.16",
"vue": "^3.4.19",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@types/node": "20.11.17",
"@unhead/vue": "^1.8.10",
"@vitejs/plugin-legacy": "^5.3.0",
"@vitejs/plugin-vue": "^5.0.3",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"autoprefixer": "^10.4.17",
Expand All @@ -41,7 +42,7 @@
"tailwindcss": "^3.4.1",
"terser": "^5.27.0",
"typescript": "^5.3.3",
"vite": "^5.1.0",
"vite": "^5.1.1",
"vue-tsc": "^1.8.27"
},
"type": "module"
Expand Down
17 changes: 17 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ import { useI18n } from 'petite-vue-i18n';
import { useSettingsStore } from './stores/settings';
import AppHeader from './components/AppHeader.vue';
import AppFooter from './components/AppFooter.vue';
import { useHead } from '@unhead/vue';
useHead({ title: 'Bandoneon.app' });
// Umami
if (import.meta.env.VITE_UMAMI_HOST && import.meta.env.VITE_UMAMI_ID) {
useHead({
script: [
{
src: import.meta.env.VITE_UMAMI_HOST + '/script.js',
async: true,
defer: true,
'data-website-id': import.meta.env.VITE_UMAMI_ID,
},
],
});
}
const settings = useSettingsStore();
const { locale } = useI18n();
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createHead } from '@unhead/vue';
import { createI18n } from 'petite-vue-i18n';
import { createPinia } from 'pinia';
import { createApp } from 'vue';
Expand All @@ -16,9 +17,11 @@ const i18n = createI18n({
});

const pinia = createPinia();
const head = createHead();

const app = createApp(App);
app.use(pinia);
app.use(head);
app.use(router);
app.use(i18n);
app.mount('#app');
3 changes: 3 additions & 0 deletions src/pages/game.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ import SvgKeyboard from '../components/SvgKeyboard.vue';
import { useKeyboard } from '../composables/useKeyboard';
import { useStore } from '../stores/main';
import { useSettingsStore } from '../stores/settings';
import { useHead } from '@unhead/vue';
useHead({ title: 'Play a game! – Bandoneon.app' });
useKeyboard();
Expand Down

0 comments on commit b49dc60

Please sign in to comment.