Skip to content

Commit

Permalink
Add build version to home page
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaBobs committed Jan 12, 2024
1 parent 49fd8df commit db29836
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- name: Build
run: |
pnpm install
pnpm build:version
pnpm build
- name: Setup Pages
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build && cp dist/index.html dist/404.html",
"build:version": "git log -n 1 --pretty=\"format:%H %aD\" > src/version.txt",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
Expand All @@ -29,4 +30,4 @@
"typescript": "5.3.2",
"vite": "5.0.5"
}
}
}
7 changes: 6 additions & 1 deletion src/sitemap.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { JapaneseSiteMap } from "@src/japanese/japanese-sitemap";
import { MythicHeroesSitemap } from "@src/mythic-heroes/mythic-heroes-sitemap";
import version from "@src/version.txt?raw";

export const BaseRoute = "playground";

Expand All @@ -24,7 +25,11 @@ export const siteMap = {
menu: { name: "Home" },
element: (
<div>
<span>Welcome to home!</span>
<span>
Welcome to home!
<br />
Version: {version}
</span>
</div>
),
},
Expand Down
1 change: 1 addition & 0 deletions src/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
49fd8df95d05efec4856a70871e2e4c003b540ce Fri, 12 Jan 2024 19:47:44 +0100

0 comments on commit db29836

Please sign in to comment.