Skip to content

Commit f12bd4d

Browse files
committed
feat(meta): add app version meta tag for debugging purposes
1 parent 63ef632 commit f12bd4d

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "marekhonzal-com",
33
"type": "module",
4-
"version": "0.0.1",
4+
"version": "0.1.0",
55
"scripts": {
66
"dev": "astro dev --host",
77
"build": "astro build",

src/components/Head.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import Analytics from '@/components/utility/Analytics.astro'
3+
import AppVersion from '@/components/utility/AppVersion.astro'
34
import CanonicalLink from '@/components/utility/CanonicalLink.astro'
45
import ColorScheme from '@/components/utility/ColorScheme.astro'
56
import Favicon from '@/components/utility/Favicon.astro'
@@ -32,5 +33,6 @@ const { title, description, ogImagePath } = Astro.props
3233
<PreloadFonts type="sans" />
3334
<OpenGraph title={title} description={description} imagePath={ogImagePath} />
3435
<ThemeColor />
36+
<AppVersion />
3537

3638
<slot />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
import { getAppVersion } from '@/lib/utils/version'
3+
4+
const version = getAppVersion()
5+
---
6+
7+
<!-- APP VERSION -->
8+
<meta name="app-version" content={version} />

src/lib/utils/version.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pkg from '../../../package.json' with { type: 'json' }
2+
3+
export const getAppVersion = () => pkg.version

0 commit comments

Comments
 (0)