Skip to content

Commit

Permalink
Добавлено: Nolebase Page Properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Ampernic committed Mar 26, 2024
1 parent 11a6006 commit d9b18b9
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 93 deletions.
17 changes: 17 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ import {
GitChangelog,
GitChangelogMarkdownSection
} from '@nolebase/vitepress-plugin-git-changelog/vite'

/* PagePropierties */
import {
PageProperties,
PagePropertiesMarkdownSection
} from '@nolebase/vitepress-plugin-page-properties/vite'

import {
gitRepository,
Expand Down Expand Up @@ -59,6 +65,17 @@ export default defineConfig({
},
sections: gitDisplay,
}),
PageProperties(),
PagePropertiesMarkdownSection({
excludes: [],
exclude: (_, { helpers }): boolean => {
for (var page of config.nolebase_exclude){
if (helpers.idEndsWith(page))
return null
}
return false
},
}),
],
ssr: {
noExternal: [
Expand Down
16 changes: 15 additions & 1 deletion .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,26 @@ import {
gitMapContributors
} from '../../_data/gitlog'

import {
NolebasePagePropertiesEditor,
} from '@nolebase/vitepress-plugin-page-properties/client'

import {
pagePropertiesLocales,
pagePropertiesMD
} from './../../_data/page-properties'

import type { Options as NolebasePagePropertiesOptions } from '@nolebase/vitepress-plugin-page-properties/client';
import { InjectionKey as NolebasePagePropertiesInjection } from '@nolebase/vitepress-plugin-page-properties/client';


/* Stylesheets */
import 'uno.css'
import './styles/style.css'
import './styles/custom.css'
import './viewerjs/dist/viewer.css'
import '@nolebase/vitepress-plugin-enhanced-readabilities/dist/style.css'
import '@nolebase/vitepress-plugin-page-properties/client/style.css'
import "vitepress-markdown-timeline/dist/theme/index.css";

export default {
Expand All @@ -55,6 +68,7 @@ export default {
'nav-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu),
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
'aside-outline-after': () => h(AGWMetaBars),
'doc-footer-before': () => h(NolebasePagePropertiesEditor)
})
},

Expand All @@ -74,7 +88,7 @@ export default {

ctx.app.component('AGWGallery', AGWGallery);
ctx.app.component('AGWCategories', AGWCategories)

ctx.app.provide(NolebasePagePropertiesInjection, {locales: pagePropertiesLocales, properties:pagePropertiesMD} as NolebasePagePropertiesOptions)
ctx.app.use(NolebaseGitChangelogPlugin, {locales: gitLocales, mapContributors: gitMapContributors})

enhanceAppWithTabs(ctx.app)
Expand Down
7 changes: 7 additions & 0 deletions .vitepress/theme/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,11 @@
* -------------------------------------------------------------------------- */
.bg-\$vp-custom-block-details-bg, .bg-vp-custom-block-details-bg{
background-color: var(--vp-c-gray-3) !important;
}

/**
* Component: Page Properties
* -------------------------------------------------------------------------- */
.VPDocFooter[data-v-29ec59c0]{
margin-top: 10px !important;
}
53 changes: 53 additions & 0 deletions _data/page-properties.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export const pagePropertiesMD = {
'ru-RU': [
{
key: 'tags',
type: 'tags',
title: 'Теги',
},
{
key: 'progress',
type: 'progress',
title: 'Прогресс',
},
{
key: 'createdAt',
type: 'datetime',
title: 'Создано',
formatAsFrom: true,
dateFnsLocaleName: 'ru',
},
{
key: 'updatedAt',
type: 'datetime',
title: 'Обновлено',
formatAsFrom: true,
dateFnsLocaleName: 'ru',
},
/*
{
key: 'wordsCount',
type: 'dynamic',
title: 'Количество слов',
options: {
type: 'wordsCount',
},
},
{
key: 'readingTime',
type: 'dynamic',
title: 'Время чтения',
options: {
type: 'readingTime',
dateFnsLocaleName: 'ru',
},
},
*/
],
}

export const pagePropertiesLocales = {
'ru-RU':{
wordsCount: '{{wordsCount}} слов'
}
}
8 changes: 8 additions & 0 deletions docs/equipment/dualshock.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
tags:
- Устройства/Геймпады
- DualShock
createdAt: 02-29-2024
progress: 70
---

# Подключение геймпадов семейства DualShock

## DualShock 3
Expand Down

0 comments on commit d9b18b9

Please sign in to comment.