Skip to content

Commit 25bcfcc

Browse files
authored
Add @cssnr/vitepress-plugin-contributors (#4)
1 parent a91109a commit 25bcfcc

File tree

6 files changed

+40
-136
lines changed

6 files changed

+40
-136
lines changed

.vitepress/get-contributors.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

.vitepress/theme/components/Contributors.vue

Lines changed: 0 additions & 74 deletions
This file was deleted.

.vitepress/theme/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ import DefaultTheme, { VPBadge } from 'vitepress/theme'
22
import './custom.css'
33
import 'virtual:group-icons.css'
44

5-
import Contributors from './components/Contributors.vue'
65
import YouTubeEmbed from './components/YouTubeEmbed.vue'
76
import StackTable from './components/StackTable.vue'
87

8+
import Contributors from '@cssnr/vitepress-plugin-contributors'
9+
import '@cssnr/vitepress-plugin-contributors/style.css'
10+
import contributors from '../contributors.json'
11+
912
// noinspection JSUnusedGlobalSymbols
1013
export default {
1114
...DefaultTheme,
1215

1316
enhanceApp({ app }) {
1417
app.component('Badge', VPBadge)
15-
app.component('Contributors', Contributors)
1618
app.component('YouTubeEmbed', YouTubeEmbed)
1719
app.component('StackTable', StackTable)
20+
21+
app.component('Contributors', Contributors)
22+
app.config.globalProperties.$contributors = contributors
1823
},
1924
}

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ div.badges {
7575

7676
</div>
7777

78-
<Contributors heading="Contributors" margin="36px 0 96px" />
78+
<Contributors :contributors="$contributors" heading="Contributors" margin="36px 0 96px" />

package-lock.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
"build": "vitepress build .",
55
"preview": "vitepress preview .",
66
"prettier": "npx prettier --check .",
7-
"get-contributors": "node .vitepress/get-contributors.js cssnr/stack-deploy-action",
7+
"get-contributors": "npx get-contributors cssnr/stack-deploy-action",
88
"postinstall": "npm run get-contributors"
99
},
1010
"dependencies": {
11+
"@cssnr/vitepress-plugin-contributors": "^0.0.1",
1112
"vitepress": "^1.6.4",
1213
"vitepress-plugin-group-icons": "^1.6.3"
1314
},

0 commit comments

Comments
 (0)