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' |
| 47 | .then((result) => result.stdout.trim())) ?? |
47 | .then((result) => result.stdout.trim())) ?? |
| 48 | 'dev') |
48 | 'dev') |
| 49 | |
49 | |
| |
50 | const 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 | |
| 50 | export const shared: UserConfig<DefaultTheme.Config> = { |
56 | export const shared: UserConfig<DefaultTheme.Config> = { |
| 51 | ...siteConfig, |
57 | ...siteConfig, |
| 52 | transformHead: async (context) => generateMeta(context, hostname), |
58 | transformHead: async (context) => generateMeta(context, hostname), |
| @@ -95,21 +101,14 @@ export const shared: UserConfig<DefaultTheme.Config> = { |
| 95 | provider: 'local' |
101 | provider: 'local' |
| 96 | }, |
102 | }, |
| 97 | logo: { src: '/asset/fav.svg' }, |
103 | logo: { src: '/asset/fav.svg' }, |
| 98 | sidebar, |
104 | 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 | } |
| |
| 110 | }, |
105 | }, |
| 111 | vite: { |
106 | vite: { |
| 112 | customLogger: logger, |
107 | customLogger: logger, |
| |
108 | define: { |
| |
109 | __GIT_COMMIT__: JSON.stringify(GIT_COMMIT), |
| |
110 | __GIT_COMMIT_TS__: parseInt(GIT_COMMIT_TIMESTAMP, 10) |
| |
111 | }, |
| 113 | experimental: { |
112 | experimental: { |
| 114 | enableNativePlugin: true |
113 | enableNativePlugin: true |
| 115 | }, |
114 | }, |
docs/.vitepress/theme/Layout.vue
+4
| @@ -28,6 +28,7 @@ import { |
| 28 | } from 'vue' |
28 | } from 'vue' |
| 29 | import { sidebar } from '../configs/constants' |
29 | import { sidebar } from '../configs/constants' |
| 30 | import AnnouncementPill from './components/AnnouncementPill.vue' |
30 | import AnnouncementPill from './components/AnnouncementPill.vue' |
| |
31 | import SiteFooter from './components/SiteFooter.vue' |
| 31 | import NotFoundComponent from './components/NotFound.vue' |
32 | import NotFoundComponent from './components/NotFound.vue' |
| 32 | import { |
33 | import { |
| 33 | NolebaseEnhancedReadabilitiesMenu, |
34 | NolebaseEnhancedReadabilitiesMenu, |
| @@ -1183,6 +1184,9 @@ onUnmounted(() => { |
| 1183 | <template #nav-screen-content-after> |
1184 | <template #nav-screen-content-after> |
| 1184 | <NolebaseEnhancedReadabilitiesScreenMenu /> |
1185 | <NolebaseEnhancedReadabilitiesScreenMenu /> |
| 1185 | </template> |
1186 | </template> |
| |
1187 | <template #layout-bottom> |
| |
1188 | <SiteFooter /> |
| |
1189 | </template> |
| 1186 | |
1190 | |
| 1187 | <template #nav-bar-title-before> |
1191 | <template #nav-bar-title-before> |
| 1188 | <span |
1192 | <span |
docs/.vitepress/theme/components/SiteFooter.vue
added
+103
| @@ -0,0 +1,103 @@ |
| |
1 | <script setup lang="ts"> |
| |
2 | import { useData } from 'vitepress' |
| |
3 | import { computed, onMounted, ref } from 'vue' |
| |
4 | |
| |
5 | const { page } = useData() |
| |
6 | const isHome = computed(() => page.value.relativePath === 'index.md') |
| |
7 | |
| |
8 | const commit = __GIT_COMMIT__ |
| |
9 | const buildAge = ref('') |
| |
10 | |
| |
11 | onMounted(() => { |
| |
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 | |
| |
79 | a { |
| |
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 | |
| |
87 | a: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' { |
| 3 | const mark: typeof Mark |
3 | const mark: typeof Mark |
| 4 | export default mark |
4 | export default mark |
| 5 | } |
5 | } |
| |
6 | |
| |
7 | declare const __GIT_COMMIT__: string |
| |
8 | declare 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); |
| 196 | } |
196 | } |
| 197 | } |
197 | } |
| 198 | |
198 | |
| 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 | } |
| |
| 212 | |
199 | |
| 213 | :root { |
200 | :root { |
| 214 | --vp-home-hero-name-color: transparent; |
201 | --vp-home-hero-name-color: transparent; |
| @@ -555,11 +542,7 @@ table tr:nth-child(odd) { |
| 555 | } |
542 | } |
| 556 | |
543 | |
| 557 | /** New Styles */ |
544 | /** New Styles */ |
| 558 | .VPFooter { |
545 | |
| 559 | .divider { |
| |
| 560 | color: var(--vp-c-divider); |
| |
| 561 | } |
| |
| 562 | } |
| |
| 563 | |
546 | |
| 564 | ::view-transition-group(root) { |
547 | ::view-transition-group(root) { |
| 565 | animation-timing-function: $ease-in-expo; |
548 | animation-timing-function: $ease-in-expo; |