Commit 39c2cf4aa0

39c2cf4aa048f02ad00ebce710c7554cdd070fc3

parent: 0fe6e32ea6

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-06-27 17:11 UTC

init

Layout: unified · split

docs/.vitepress/configs/index.ts +11 −12
@@ -47,6 +47,12 @@ const GIT_COMMIT = process.env.NODE_ENV === 'development'
4747 .then((result) => result.stdout.trim())) ??
4848 'dev')
4949
50const GIT_COMMIT_TIMESTAMP = process.env.NODE_ENV === 'development'
51 ? String(Math.floor(Date.now() / 1000))
52 : ((await (await import('tinyexec'))
53 .x('git', ['log', '-1', '--format=%ct', 'HEAD'])
54 .then((result) => result.stdout.trim())) ?? String(Math.floor(Date.now() / 1000)))
55
5056export const shared: UserConfig<DefaultTheme.Config> = {
5157 ...siteConfig,
5258 transformHead: async (context) => generateMeta(context, hostname),
@@ -95,21 +101,14 @@ export const shared: UserConfig<DefaultTheme.Config> = {
95101 provider: 'local'
96102 },
97103 logo: { src: '/asset/fav.svg' },
98 sidebar,
99 socialLinks: [
100 { icon: 'github', link: 'https://github.com/wotakumoe/Wotaku' },
101 { icon: 'discord', link: 'https://discord.gg/vShRGx8ZBC' }
102 ],
103 footer: {
104 message:
105 `<a href="https://github.com/wotakumoe">The Wotaku Team</a> <span class="divider">|</span> <a href="https://github.com/wotakumoe/Wotaku/commit/${GIT_COMMIT}">${
106 GIT_COMMIT.slice(0, 7)
107 }</a>`,
108 copyright: 'made with love and eepy energy'
109 }
104 sidebar
110105 },
111106 vite: {
112107 customLogger: logger,
108 define: {
109 __GIT_COMMIT__: JSON.stringify(GIT_COMMIT),
110 __GIT_COMMIT_TS__: parseInt(GIT_COMMIT_TIMESTAMP, 10)
111 },
113112 experimental: {
114113 enableNativePlugin: true
115114 },
docs/.vitepress/theme/Layout.vue +4
@@ -28,6 +28,7 @@ import {
2828} from 'vue'
2929import { sidebar } from '../configs/constants'
3030import AnnouncementPill from './components/AnnouncementPill.vue'
31import SiteFooter from './components/SiteFooter.vue'
3132import NotFoundComponent from './components/NotFound.vue'
3233import {
3334 NolebaseEnhancedReadabilitiesMenu,
@@ -1183,6 +1184,9 @@ onUnmounted(() => {
11831184 <template #nav-screen-content-after>
11841185 <NolebaseEnhancedReadabilitiesScreenMenu />
11851186 </template>
1187 <template #layout-bottom>
1188 <SiteFooter />
1189 </template>
11861190
11871191 <template #nav-bar-title-before>
11881192 <span
docs/.vitepress/theme/components/SiteFooter.vue added +103
@@ -0,0 +1,103 @@
1<script setup lang="ts">
2import { useData } from 'vitepress'
3import { computed, onMounted, ref } from 'vue'
4
5const { page } = useData()
6const isHome = computed(() => page.value.relativePath === 'index.md')
7
8const commit = __GIT_COMMIT__
9const buildAge = ref('')
10
11onMounted(() => {
12 const diff = Math.floor(Date.now() / 1000 - __GIT_COMMIT_TS__)
13 const rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' })
14 let label: string
15 if (diff < 3600) label = rtf.format(-Math.floor(diff / 60), 'minute')
16 else if (diff < 86400) label = rtf.format(-Math.floor(diff / 3600), 'hour')
17 else if (diff < 2592000) label = rtf.format(-Math.floor(diff / 86400), 'day')
18 else label = rtf.format(-Math.floor(diff / 2592000), 'month')
19 buildAge.value = `Updated ${label}`
20})
21</script>
22
23<template>
24 <footer v-if="isHome" class="site-footer">
25 <span class="footer-left">
26 <span v-if="buildAge">{{ buildAge }}</span>
27 <span v-if="buildAge" class="divider">|</span>
28 <a :href="`https://github.com/wotakumoe/Wotaku/commit/${commit}`" class="no-icon">{{ commit.slice(0, 7) }}</a>
29 </span>
30 <span class="footer-right">
31 <a href="https://github.com/wotakumoe/Wotaku" aria-label="GitHub" class="icon-link no-icon" target="_blank" rel="noopener">
32 <span class="i-simple-icons:github" />
33 </a>
34 <a href="https://discord.gg/vShRGx8ZBC" aria-label="Discord" class="icon-link no-icon" target="_blank" rel="noopener">
35 <span class="i-simple-icons:discord" />
36 </a>
37 </span>
38 </footer>
39</template>
40
41<style scoped>
42.site-footer {
43 position: relative;
44 display: flex;
45 justify-content: space-between;
46 align-items: center;
47 padding: 12px 24px;
48 font-size: 12px;
49 color: var(--vp-c-text-2);
50 background-color: var(--vp-c-bg);
51}
52
53.site-footer::before {
54 content: '';
55 position: absolute;
56 top: 0;
57 left: 0;
58 right: 0;
59 height: 1px;
60 background: linear-gradient(to right, transparent, var(--vp-c-divider), transparent);
61}
62
63.footer-left {
64 display: flex;
65 align-items: center;
66 gap: 8px;
67}
68
69.footer-right {
70 display: flex;
71 align-items: center;
72 gap: 12px;
73}
74
75.divider {
76 color: var(--vp-c-divider);
77}
78
79a {
80 color: var(--vp-c-text-2);
81 text-decoration-line: underline;
82 text-decoration-style: dashed;
83 text-underline-offset: 5px;
84 transition: color 0.3s;
85}
86
87a:hover {
88 color: var(--vp-c-text-1);
89}
90
91.icon-link {
92 display: flex;
93 align-items: center;
94 font-size: 20px;
95 text-decoration: none;
96 color: var(--vp-c-text-2);
97 transition: color 0.3s;
98}
99
100.icon-link:hover {
101 color: var(--vp-c-text-1);
102}
103</style>
docs/.vitepress/theme/shim.d.ts +3
@@ -3,3 +3,6 @@ declare module 'mark.js/dist/mark.es6.js' {
33 const mark: typeof Mark
44 export default mark
55}
6
7declare const __GIT_COMMIT__: string
8declare const __GIT_COMMIT_TS__: number
docs/.vitepress/theme/styles/style.scss +1 −18
@@ -196,19 +196,6 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0);
196196 }
197197}
198198
199.VPFooter a {
200 text-decoration-line: underline;
201 text-decoration-style: dashed;
202 text-underline-offset: 5px;
203 transition: 0.3s;
204
205 &:hover {
206 color: var(--vp-c-text-1);
207 text-decoration-line: underline;
208 text-decoration-style: dashed;
209 text-underline-offset: 5px;
210 }
211}
212199
213200:root {
214201 --vp-home-hero-name-color: transparent;
@@ -555,11 +542,7 @@ table tr:nth-child(odd) {
555542}
556543
557544/** New Styles */
558.VPFooter {
559 .divider {
560 color: var(--vp-c-divider);
561 }
562}
545
563546
564547::view-transition-group(root) {
565548 animation-timing-function: $ease-in-expo;