diff --git a/package.json b/package.json index af7a5b7..022140e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "vue-nonograms-solid", "version": "1.9.13", + "homepage": "https://nonograms.7u.pl/", "type": "module", "scripts": { "dev": "vite", diff --git a/src/utils/shareUtils.js b/src/utils/shareUtils.js index 1095c9c..66ae63d 100644 --- a/src/utils/shareUtils.js +++ b/src/utils/shareUtils.js @@ -4,7 +4,7 @@ export function buildShareCanvas(data, t, formattedTime) { const { grid, size, currentDensity, guideUsageCount } = data; if (!grid || !grid.length) return null; - const appUrl = 'https://nonograms.7u.pl/'; + const appUrl = typeof __APP_HOMEPAGE__ !== 'undefined' ? __APP_HOMEPAGE__ : ''; const maxBoard = 640; const cellSize = Math.max(8, Math.floor(maxBoard / size)); const boardSize = cellSize * size; @@ -119,7 +119,7 @@ export function buildShareSVG(data, t, formattedTime) { const { grid, size, currentDensity, guideUsageCount } = data; if (!grid || !grid.length) return null; - const appUrl = 'https://nonograms.7u.pl/'; + const appUrl = typeof __APP_HOMEPAGE__ !== 'undefined' ? __APP_HOMEPAGE__ : ''; const maxBoard = 640; const cellSize = Math.max(8, Math.floor(maxBoard / size)); const boardSize = cellSize * size; diff --git a/vite.config.js b/vite.config.js index eae6c43..66de840 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,7 +5,8 @@ import path from 'path' export default defineConfig({ define: { - '__APP_VERSION__': JSON.stringify(process.env.npm_package_version) + '__APP_VERSION__': JSON.stringify(process.env.npm_package_version), + '__APP_HOMEPAGE__': JSON.stringify(process.env.npm_package_homepage) }, plugins: [ vue(),