Skip to content

Commit

Permalink
feat: add contributors option for landing (resolves #48)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 21, 2024
1 parent f34b546 commit d750691
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/.config/docs.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// "heroLinks": {
// "stackblitz": { "icon": "i-heroicons-play", "to": "https://stackblitz.com/github/unjs/docs/tree/main/template" }
// },
"contributors": true,
"features": [
{ "title": "Eazy to use", "description": "Focus on writing your documentation with Markdown, not tooling." },
{ "title": "Nuxt powered", "description": "Made with Nuxt, Nuxt Content, Nuxt SEO and Nuxt UI Pro." },
Expand Down
1 change: 1 addition & 0 deletions docs/1.guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Build for production:
"github": "unjs/packageName",
"redirects": {},
"landing": {
"contributors": true,
"heroCode": "",
"heroLinks": {},
"features": []
Expand Down
2 changes: 2 additions & 0 deletions layers/core/app/modules/content/landing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export function genLanding(docsConfig) {
// Features
featuresTitle: '',
features: [],

_github: docsConfig.github,
})

landing._heroMdTitle =
Expand Down
8 changes: 8 additions & 0 deletions layers/core/app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,12 @@ const hero = computed(() => {
</UPageGrid>
</ULandingSection>
</template>
<ULandingSection v-if="page.contributors && page._github" title="Made by community">
<UContainer>
<a :href="`https://github.com/${page._github}/graphs/contributors`" target="_blank">
<img :src="`https://contrib.rocks/image?repo=${page._github}`" />
</a>
</UContainer>
</ULandingSection>
</template>
1 change: 1 addition & 0 deletions schema/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface DocsConfig {
themeColor?: string
redirects?: Record<string, string>
automd?: any
contributors?: boolean
landing?:
| false
| {
Expand Down
4 changes: 4 additions & 0 deletions schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
"type": "string",
"description": "Page description"
},
"contributors": {
"type": "boolean",
"description": "Show contributors section"
},
"features": {
"type": "array",
"description": "Features section description",
Expand Down
1 change: 1 addition & 0 deletions template/.config/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"github": "unjs/packageName",
"redirects": {},
"landing": {
"contributors": false,
"heroCode": "",
"heroLinks": {},
"features": []
Expand Down

0 comments on commit d750691

Please sign in to comment.