added commit hash to footer

This commit is contained in:
2026-01-29 17:20:03 +01:00
parent cbc00e1cd7
commit b1649f5911
2 changed files with 11 additions and 0 deletions

View File

@@ -1,4 +1,6 @@
<script lang="ts"> <script lang="ts">
import { version } from '$app/environment';
var ratCounter = 0; var ratCounter = 0;
let playSound = function() { let playSound = function() {
@@ -18,6 +20,7 @@
<div class="content-container"> <div class="content-container">
<div class="content-box center-box"> <div class="content-box center-box">
<p> 20232026 denizk0461</p> <p> 20232026 denizk0461</p>
<p>Built from commit <a class="commit" href="https://codeberg.org/denizk0461/pages-svelte/src/commit/{version}">{version.substring(0, 6)}</a></p>
</div> </div>
<div class="content-box"> <div class="content-box">
<h6>Content</h6> <h6>Content</h6>
@@ -103,6 +106,10 @@
margin: auto 0; margin: auto 0;
} }
.commit {
display: inline;
}
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
.content-container { .content-container {
flex-direction: column; flex-direction: column;

View File

@@ -1,6 +1,7 @@
import adapter from '@sveltejs/adapter-node'; import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { mdsvex } from 'mdsvex'; import { mdsvex } from 'mdsvex';
import * as child_process from 'node:child_process';
const missingPaths = [ const missingPaths = [
// "/games/swordsnstuff", // "/games/swordsnstuff",
@@ -24,6 +25,9 @@ const config = {
handleMissingId: 'warn', handleMissingId: 'warn',
handleUnseenRoutes: 'warn', handleUnseenRoutes: 'warn',
}, },
version: {
name: child_process.execSync('git rev-parse HEAD').toString().trim()
},
}, },
extensions: ['.svelte', '.md'], extensions: ['.svelte', '.md'],
preprocess: [ preprocess: [