add commit sha to footer

This commit is contained in:
taskylizard 2023-11-04 12:26:40 +05:30
parent 0c604f89ee
commit bf504e0b26
No known key found for this signature in database
GPG Key ID: 5CABA3D642DDC497
2 changed files with 15 additions and 1 deletions

View File

@ -2,7 +2,7 @@ import { defineConfig } from "vitepress";
import { withPwa } from "@vite-pwa/vitepress"; import { withPwa } from "@vite-pwa/vitepress";
import UnoCSS from "unocss/vite"; import UnoCSS from "unocss/vite";
import { presetUno, presetAttributify, presetIcons } from "unocss"; import { presetUno, presetAttributify, presetIcons } from "unocss";
import { meta } from "./constants"; import { commitRef, meta } from "./constants";
import { pwa } from "./pwa"; import { pwa } from "./pwa";
import { generateMeta } from "./hooks/meta"; import { generateMeta } from "./hooks/meta";
@ -62,6 +62,9 @@ export default defineConfig({
}, },
provider: "local", provider: "local",
}, },
footer: {
message: `Made with ❤️ (${commitRef})`,
},
outline: "deep", outline: "deep",
logo: "/fmhy.ico", logo: "/fmhy.ico",
nav: [ nav: [

View File

@ -5,3 +5,14 @@ export const meta = {
hostname: "https://fmhy.pages.dev", hostname: "https://fmhy.pages.dev",
keywords: ["stream", "movies", "gaming", "reading", "anime"], keywords: ["stream", "movies", "gaming", "reading", "anime"],
}; };
// Netlify to Cloudflare otherwise dev
export const commitRef = process.env.COMMIT_REF
? `<a href="https://github.com/fmhy/FMHYEdit/commit/${
process.env.COMMIT_REF
}">${process.env.COMMIT_REF.slice(0, 8)}</a>`
: process.env.CF_PAGES_COMMIT_SHA
? `<a href="https://github.com/fmhy/FMHYEdit/commit/${
process.env.CF_PAGES_COMMIT_SHA
}">${process.env.CF_PAGES_COMMIT_SHA.slice(0, 8)}</a>`
: "dev";