From defdf0ee0b18d496a9d523ba7d205914857177d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=A9=D0=B0=D0=B2=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2?= Date: Thu, 11 Jul 2024 20:51:52 +0300 Subject: [PATCH] .vitepress: add vitepress-plugin-git-changelog --- .vitepress/config/shared.ts | 15 ++++++++++++--- .vitepress/theme/index.ts | 8 ++++++++ .vitepress/theme/styles/theme.css | 10 +++++++++- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/.vitepress/config/shared.ts b/.vitepress/config/shared.ts index 44e1dfb..8e14c63 100644 --- a/.vitepress/config/shared.ts +++ b/.vitepress/config/shared.ts @@ -1,16 +1,25 @@ -import { defineConfigWithTheme } from 'vitepress' +import { defineConfig } from 'vitepress' import markdownTimeline from "vitepress-markdown-timeline" import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' import UnoCSS from 'unocss/vite' +import { + GitChangelog, + GitChangelogMarkdownSection, +} from '@nolebase/vitepress-plugin-git-changelog/vite' -export const shared = defineConfigWithTheme({ +export const shared = defineConfig({ title: "ALT Mobile Wiki", titleTemplate: ':title — ALT Mobile Wiki', base: '/ALTMobileWiki/', srcDir: './docs', vite: { plugins: [ - UnoCSS() + UnoCSS(), + GitChangelog({ + // Fill in your repository URL here + repoURL: () => 'https://github.com/OlegShchavelev/ALTMobileWiki', + }), + GitChangelogMarkdownSection(), ], optimizeDeps: { exclude: ['@nolebase/vitepress-plugin-enhanced-readabilities/client'] diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 85ab957..fc35845 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -14,12 +14,19 @@ import { import type { Options } from '@nolebase/vitepress-plugin-enhanced-readabilities/client' import { NolebaseEnhancedReadabilitiesPlugin } from '@nolebase/vitepress-plugin-enhanced-readabilities/client' import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css' + +import { + NolebaseGitChangelogPlugin +} from '@nolebase/vitepress-plugin-git-changelog/client' + + import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' import './styles/style.css' import './styles/theme.css' import 'uno.css' import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css' +import '@nolebase/vitepress-plugin-git-changelog/client/style.css' import "vitepress-markdown-timeline/dist/theme/index.css" import { ERlocales } from '../data/lexicon' @@ -35,6 +42,7 @@ export default { }, enhanceApp({ app }) { app.use(NolebaseEnhancedReadabilitiesPlugin, {locales: ERlocales} as Options) + app.use(NolebaseGitChangelogPlugin) app.component('contribution', AMWContribution) app.component('Video', AMWVideo) enhanceAppWithTabs(app) diff --git a/.vitepress/theme/styles/theme.css b/.vitepress/theme/styles/theme.css index cb3a12e..3611417 100644 --- a/.vitepress/theme/styles/theme.css +++ b/.vitepress/theme/styles/theme.css @@ -114,4 +114,12 @@ .VPHomeSponsors .message { max-width: 800px; - } \ No newline at end of file + } + + /** + * Component: GitChangeLog + * -------------------------------------------------------------------------- */ +.bg-\$vp-custom-block-details-bg, +.bg-vp-custom-block-details-bg { + background-color: var(--vp-c-gray-3) !important; +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e6beb57..9f23a20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "devDependencies": { "@nolebase/ui": "^2.2.2", "@nolebase/vitepress-plugin-enhanced-readabilities": "^2.2.2", - "@nolebase/vitepress-plugin-git-changelog": "^2.2.0", + "@nolebase/vitepress-plugin-git-changelog": "^2.2.2", "@types/node": "^20.14.8", "vitepress": "^1.0.2", "vitepress-markdown-timeline": "^1.2.1", diff --git a/package.json b/package.json index 9899fb1..fe35ca1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "devDependencies": { "@nolebase/ui": "^2.2.2", "@nolebase/vitepress-plugin-enhanced-readabilities": "^2.2.2", - "@nolebase/vitepress-plugin-git-changelog": "^2.2.0", + "@nolebase/vitepress-plugin-git-changelog": "^2.2.2", "@types/node": "^20.14.8", "vitepress": "^1.0.2", "vitepress-markdown-timeline": "^1.2.1",