Skip to content

Commit ca8d136

Browse files
docs(homepage): show sponsors on homepage (bootstrap-vue#4729)
* feat(docs): show sponsors on homepage * Update sponsors-backers-donors.vue * Update sponsors-backers-donors.vue * move become a sponsor button first * Improve contributors request handling and code reuse * Correct docs component names * Update contributors.vue * Update README.md * Added .github/ISSUE_TEMPLATE.md (optional) * Updated .github/PULL_REQUEST_TEMPLATE.md (optional) * Revert "Added .github/ISSUE_TEMPLATE.md (optional)" This reverts commit 3649611. * Revert "Updated .github/PULL_REQUEST_TEMPLATE.md (optional)" This reverts commit bb150f7. Co-authored-by: Troy Morehouse <troymore@nbnet.nb.ca>
1 parent 865a655 commit ca8d136

16 files changed

+400
-189
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<p align="center">
99
BootstrapVue, with over 40 available plugins, more than 80 custom components, and over 300 icons,
10-
provides one of the most comprehensive implementations of the Bootstrap v4.3 component and grid
10+
provides one of the most comprehensive implementations of the Bootstrap v4 component and grid
1111
system for Vue.js, complete with extensive and automated WAI-ARIA accessibility markup.
1212
</p>
1313
<br>

docs/components/anchored-heading.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { mergeData } from 'vue-functional-data-merge'
22

33
export default {
4-
name: 'BDVAnchoredHeading',
4+
name: 'BVDAnchoredHeading',
55
functional: true,
66
props: {
77
id: {

docs/components/backers-donors.vue

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

docs/components/componentdoc.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ import { kebabCase } from '../utils'
323323
import AnchoredHeading from './anchored-heading'
324324
325325
export default {
326-
name: 'BDVComponentdoc',
326+
name: 'BVDComponentdoc',
327327
components: { AnchoredHeading },
328328
props: {
329329
component: {},
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import { mergeData } from 'vue-functional-data-merge'
2+
3+
const CLASS_NAME = 'contributors-container'
4+
const CONTRIBUTOR_CLASS_NAME = 'contributor'
5+
6+
export default {
7+
name: 'BVDContributorsContainer',
8+
functional: true,
9+
props: {
10+
type: {
11+
type: String,
12+
required: true
13+
},
14+
contributors: {
15+
type: Array,
16+
default: () => []
17+
},
18+
showName: {
19+
type: Boolean,
20+
default: true
21+
}
22+
},
23+
render(h, { props, data }) {
24+
const { type, contributors, showName } = props
25+
26+
if (contributors.length === 0) {
27+
return h()
28+
}
29+
30+
const renderContributor = contributor => {
31+
const { name, slug, imageUrl, website } = contributor
32+
33+
const $image = h('b-img-lazy', {
34+
props: {
35+
src: imageUrl,
36+
fluid: true,
37+
block: true,
38+
alt: 'Contributor image'
39+
}
40+
})
41+
42+
const $thumbnail = h(
43+
'div',
44+
{
45+
staticClass: `${CONTRIBUTOR_CLASS_NAME}-thumbnail`,
46+
class: [
47+
'img-thumbnail',
48+
'd-flex',
49+
'flex-wrap',
50+
'align-items-center',
51+
'justify-content-center',
52+
'overflow-hidden'
53+
]
54+
},
55+
[$image]
56+
)
57+
58+
let $name = h()
59+
if (showName) {
60+
$name = h(
61+
'div',
62+
{
63+
staticClass: `${CONTRIBUTOR_CLASS_NAME}-name`,
64+
class: ['small', 'mb-0 ', 'pt-2', 'text-break']
65+
},
66+
[name]
67+
)
68+
}
69+
70+
// When contributor has a website, wrap the content in a link
71+
let $content = [$thumbnail, $name]
72+
if (website) {
73+
$content = h(
74+
'b-link',
75+
{
76+
class: ['text-reset'],
77+
props: { href: website, target: '_blank' }
78+
},
79+
[$content]
80+
)
81+
}
82+
83+
return h(
84+
'div',
85+
{
86+
staticClass: CONTRIBUTOR_CLASS_NAME,
87+
class: ['m-1', 'position-relative'],
88+
key: slug
89+
},
90+
[$content]
91+
)
92+
}
93+
94+
return h(
95+
'div',
96+
mergeData(data, {
97+
staticClass: CLASS_NAME,
98+
class: [
99+
type,
100+
'd-flex',
101+
'flex-wrap',
102+
'mx-n2',
103+
'text-center',
104+
'justify-content-center',
105+
'font-weight-bold'
106+
]
107+
}),
108+
contributors.map(contributor => renderContributor(contributor))
109+
)
110+
}
111+
}

0 commit comments

Comments
 (0)