mirror of
https://github.com/eugene-serb/wavelovers.git
synced 2023-09-09 23:41:16 +03:00
- install my new two packages vue-query-router and vue-meta-tag-updater.
- deleted models and modules folders. - modified all metas assets, metas and queries for new types. - updated router index. - updated sitemaps. - up minor version. - build.
This commit is contained in:
parent
b368b359d8
commit
bd4f7017b0
@ -15,4 +15,4 @@
|
||||
webvisor: true
|
||||
});</script><style>[v-cloak] {
|
||||
display: none;
|
||||
}</style><script defer="defer" src="/js/chunk-vendors.34a275bd.js"></script><script defer="defer" src="/js/app.5845d133.js"></script><link href="/css/app.61999447.css" rel="stylesheet"></head><body><div id="app" class="app" v-cloak></div><noscript>You need to enable JavaScript to run this app.</noscript><noscript><div><img src="https://mc.yandex.ru/watch/89252711" style="position:absolute; left:-9999px;" alt=""/></div></noscript></body></html>
|
||||
}</style><script defer="defer" src="/js/chunk-vendors.297a1b69.js"></script><script defer="defer" src="/js/app.1c4bcced.js"></script><link href="/css/app.61999447.css" rel="stylesheet"></head><body><div id="app" class="app" v-cloak></div><noscript>You need to enable JavaScript to run this app.</noscript><noscript><div><img src="https://mc.yandex.ru/watch/89252711" style="position:absolute; left:-9999px;" alt=""/></div></noscript></body></html>
|
2
docs/js/app.1c4bcced.js
Normal file
2
docs/js/app.1c4bcced.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/js/app.1c4bcced.js.map
Normal file
1
docs/js/app.1c4bcced.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
docs/js/chunk-vendors.297a1b69.js.map
Normal file
1
docs/js/chunk-vendors.297a1b69.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,43 +2,43 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/custom</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/manual</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/diagnostic</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/faq</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/about</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/donate</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
|
@ -2,6 +2,6 @@
|
||||
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<sitemap>
|
||||
<loc>https://wavelovers.ru/sitemap-internal.xml</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
</sitemap>
|
||||
</sitemapindex>
|
||||
|
38
package-lock.json
generated
38
package-lock.json
generated
@ -1,16 +1,18 @@
|
||||
{
|
||||
"name": "wavelovers",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "wavelovers",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"license": "GNU GPL v3",
|
||||
"dependencies": {
|
||||
"core-js": "^3.8.3",
|
||||
"vue": "^3.2.13",
|
||||
"vue-meta-tag-updater": "^1.0.2",
|
||||
"vue-query-router": "^1.0.12",
|
||||
"vue-router": "^4.0.3",
|
||||
"vuex": "^4.0.0"
|
||||
},
|
||||
@ -11150,6 +11152,22 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-meta-tag-updater": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vue-meta-tag-updater/-/vue-meta-tag-updater-1.0.2.tgz",
|
||||
"integrity": "sha512-BVDMlSiBldxSyYjvJxpttv3+cy++5rQZOPvnWj3H/7Rmwmq+y7KJXQpTf9uNFKRRkTJ4c6EWkKgDnKlGK5DPdQ==",
|
||||
"dependencies": {
|
||||
"vue-router": "^4.1.5"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-query-router": {
|
||||
"version": "1.0.12",
|
||||
"resolved": "https://registry.npmjs.org/vue-query-router/-/vue-query-router-1.0.12.tgz",
|
||||
"integrity": "sha512-FdvROXGnsqIO+Do/Mh6La3Rle00AyB3s5DdWeGfK2BfqSeLC3HJBD2ae48rk/SA2H1qr6WESuh+TJiOAdX5TAA==",
|
||||
"dependencies": {
|
||||
"vue-router": "^4.1.5"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-router": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.5.tgz",
|
||||
@ -20188,6 +20206,22 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"vue-meta-tag-updater": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vue-meta-tag-updater/-/vue-meta-tag-updater-1.0.2.tgz",
|
||||
"integrity": "sha512-BVDMlSiBldxSyYjvJxpttv3+cy++5rQZOPvnWj3H/7Rmwmq+y7KJXQpTf9uNFKRRkTJ4c6EWkKgDnKlGK5DPdQ==",
|
||||
"requires": {
|
||||
"vue-router": "^4.1.5"
|
||||
}
|
||||
},
|
||||
"vue-query-router": {
|
||||
"version": "1.0.12",
|
||||
"resolved": "https://registry.npmjs.org/vue-query-router/-/vue-query-router-1.0.12.tgz",
|
||||
"integrity": "sha512-FdvROXGnsqIO+Do/Mh6La3Rle00AyB3s5DdWeGfK2BfqSeLC3HJBD2ae48rk/SA2H1qr6WESuh+TJiOAdX5TAA==",
|
||||
"requires": {
|
||||
"vue-router": "^4.1.5"
|
||||
}
|
||||
},
|
||||
"vue-router": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.5.tgz",
|
||||
|
11
package.json
11
package.json
@ -1,8 +1,13 @@
|
||||
{
|
||||
"name": "wavelovers",
|
||||
"description": "Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.",
|
||||
"keywords": [ "wavelovers", "gamepad-vibrator", "gamepad-test-tool", "gamepad-vibration-test-tool" ],
|
||||
"version": "1.1.0",
|
||||
"keywords": [
|
||||
"wavelovers",
|
||||
"gamepad-vibrator",
|
||||
"gamepad-test-tool",
|
||||
"gamepad-vibration-test-tool"
|
||||
],
|
||||
"version": "1.2.0",
|
||||
"license": "GNU GPL v3",
|
||||
"homepage": "https://wavelovers.ru/",
|
||||
"author": {
|
||||
@ -26,6 +31,8 @@
|
||||
"dependencies": {
|
||||
"core-js": "^3.8.3",
|
||||
"vue": "^3.2.13",
|
||||
"vue-meta-tag-updater": "^1.0.2",
|
||||
"vue-query-router": "^1.0.12",
|
||||
"vue-router": "^4.0.3",
|
||||
"vuex": "^4.0.0"
|
||||
},
|
||||
|
@ -2,43 +2,43 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/custom</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/manual</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/diagnostic</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/faq</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/about</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://wavelovers.ru/donate</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
|
@ -2,6 +2,6 @@
|
||||
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<sitemap>
|
||||
<loc>https://wavelovers.ru/sitemap-internal.xml</loc>
|
||||
<lastmod>2022-09-10</lastmod>
|
||||
<lastmod>2022-09-11</lastmod>
|
||||
</sitemap>
|
||||
</sitemapindex>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IRouteMeta from '@/router/models/IRouteMeta';
|
||||
import IRouteMeta from 'vue-meta-tag-updater/src/types/IRouteMeta';
|
||||
import metaPatterns from '@/router/assets/metas/Patterns';
|
||||
import metaCustom from '@/router/assets/metas/Custom';
|
||||
import metaManual from '@/router/assets/metas/Manual';
|
||||
@ -10,35 +10,35 @@ import meta404 from '@/router/assets/metas/404';
|
||||
|
||||
const metas: Array<IRouteMeta> = [
|
||||
{
|
||||
route: '/',
|
||||
path: '/',
|
||||
meta: metaPatterns,
|
||||
},
|
||||
{
|
||||
route: '/custom',
|
||||
path: '/custom',
|
||||
meta: metaCustom,
|
||||
},
|
||||
{
|
||||
route: '/manual',
|
||||
path: '/manual',
|
||||
meta: metaManual,
|
||||
},
|
||||
{
|
||||
route: '/diagnostic',
|
||||
path: '/diagnostic',
|
||||
meta: metaDiagnostic,
|
||||
},
|
||||
{
|
||||
route: '/faq',
|
||||
path: '/faq',
|
||||
meta: metaFaq,
|
||||
},
|
||||
{
|
||||
route: '/about',
|
||||
path: '/about',
|
||||
meta: metaAbout,
|
||||
},
|
||||
{
|
||||
route: '/donate',
|
||||
path: '/donate',
|
||||
meta: metaDonate,
|
||||
},
|
||||
{
|
||||
route: '/404',
|
||||
path: '/404',
|
||||
meta: meta404,
|
||||
},
|
||||
];
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers – Page not found',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers – About',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers – Custom',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers – Diagnostic',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers – Donate',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers – FAQ',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers – Manual',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
import IMeta from 'vue-meta-tag-updater/src/types/IMeta';
|
||||
|
||||
const meta: IMeta = {
|
||||
title: 'Wavelovers',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import IQueryRoute from '@/router/models/IQueryRoute';
|
||||
import IQueryRoute from 'vue-query-router/src/types/IQueryRoute';
|
||||
|
||||
const queries: Array<IQueryRoute> = [
|
||||
{
|
||||
|
@ -2,8 +2,8 @@ import {
|
||||
createRouter, createWebHistory,
|
||||
NavigationGuardNext, RouteLocationNormalized
|
||||
} from 'vue-router';
|
||||
import QueryRouter from '@/router/modules/QueryRouter';
|
||||
import MetaTagUpdater from '@/router/modules/MetaTagUpdater';
|
||||
import QueryRouter from 'vue-query-router';
|
||||
import MetaTagUpdater from 'vue-meta-tag-updater';
|
||||
import routes from '@/router/assets/routes';
|
||||
import queries from '@/router/assets/queries';
|
||||
import metas from '@/router/assets/metas';
|
||||
|
@ -1,9 +0,0 @@
|
||||
import ITag from '@/router/models/ITag';
|
||||
|
||||
interface IMeta {
|
||||
title: string;
|
||||
metaTags: Array<ITag>;
|
||||
linkTags: Array<ITag>;
|
||||
}
|
||||
|
||||
export default IMeta;
|
@ -1,6 +0,0 @@
|
||||
interface IQueryRoute {
|
||||
query: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export default IQueryRoute;
|
@ -1,8 +0,0 @@
|
||||
import IMeta from '@/router/models/IMeta';
|
||||
|
||||
interface IRouteMeta {
|
||||
route: string;
|
||||
meta: IMeta;
|
||||
}
|
||||
|
||||
export default IRouteMeta;
|
@ -1,5 +0,0 @@
|
||||
interface ITag {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export default ITag;
|
2
src/router/modules.d.ts
vendored
Normal file
2
src/router/modules.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
declare module 'vue-query-router';
|
||||
declare module 'vue-meta-tag-updater';
|
@ -1,59 +0,0 @@
|
||||
import { NavigationGuardNext, RouteLocationNormalized } from "vue-router";
|
||||
import IRouteMeta from "@/router/models/IRouteMeta";
|
||||
import ITag from '@/router/models/ITag';
|
||||
|
||||
function appendTags(tagsArray: object[], type: string) {
|
||||
tagsArray.map(
|
||||
(meta: object) => {
|
||||
const tag = document.createElement(type);
|
||||
|
||||
(Object.keys(meta) as Array<keyof typeof meta>)
|
||||
.forEach((key) => {
|
||||
tag.setAttribute(key, meta[key] as string);
|
||||
});
|
||||
tag.setAttribute('data-vue-router-controlled', '');
|
||||
|
||||
return tag;
|
||||
}
|
||||
).forEach(tag => document.head.appendChild(tag));
|
||||
}
|
||||
|
||||
function updateMetatag(
|
||||
to: RouteLocationNormalized,
|
||||
from: RouteLocationNormalized,
|
||||
next: NavigationGuardNext,
|
||||
metas: Array<IRouteMeta>
|
||||
) {
|
||||
Array.from(document.querySelectorAll('[data-vue-router-controlled]'))
|
||||
.map(el => {
|
||||
if (el.parentNode) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
});
|
||||
|
||||
let title: string = '' as string;
|
||||
let metaTags: Array<ITag> = [] as Array<ITag>;
|
||||
let linkTags: Array<ITag> = [] as Array<ITag>;
|
||||
|
||||
metas.forEach((item) => {
|
||||
if (item.route === to.fullPath) {
|
||||
if (item.meta) {
|
||||
title = item.meta.title;
|
||||
metaTags = item.meta.metaTags;
|
||||
linkTags = item.meta.linkTags;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (title) document.title = title;
|
||||
if (metaTags) appendTags(metaTags, 'meta');
|
||||
if (linkTags) appendTags(linkTags, 'link');
|
||||
|
||||
return next();
|
||||
}
|
||||
|
||||
const MetaTagUpdater = {
|
||||
update: updateMetatag,
|
||||
};
|
||||
|
||||
export default MetaTagUpdater;
|
@ -1,25 +0,0 @@
|
||||
import {
|
||||
Router, NavigationGuardNext, RouteLocationNormalized
|
||||
} from "vue-router";
|
||||
import IQueryRoute from '@/router/models/IQueryRoute';
|
||||
|
||||
function updateRoute(
|
||||
to: RouteLocationNormalized,
|
||||
from: RouteLocationNormalized,
|
||||
next: NavigationGuardNext,
|
||||
router: Router,
|
||||
routes: Array<IQueryRoute>
|
||||
): void {
|
||||
routes.forEach((route) => {
|
||||
if (route.query === to.fullPath) {
|
||||
router.push(route.path);
|
||||
}
|
||||
});
|
||||
return next();
|
||||
}
|
||||
|
||||
const QueryRouter = {
|
||||
update: updateRoute,
|
||||
};
|
||||
|
||||
export default QueryRouter;
|
Loading…
Reference in New Issue
Block a user