10000 Social ❤ · thomasfowler/bootstrap-vue@99cc62f · GitHub
[go: up one dir, main page]

Skip to content

Commit 99cc62f

Browse files
committed
Social ❤
1 parent 0550074 commit 99cc62f

File tree

7 files changed

+72
-3
lines changed

7 files changed

+72
-3
lines changed

docs/includes/nav.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<a class="nav-item nav-link "
2929
href="https://github.com/bootstrap-vue/bootstrap-vue"
3030
target="_blank"
31-
>Fork on GitHub</a>
31+
>Fork on GitHub</a>
3232
</li>
3333
</ul>
3434
</div>

docs/layouts/components.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
Over a dozen reusable components built to provide buttons, dropdowns, input groups, navigation, alerts, and
66
much more.
77
</template>
8+
<template slot="actions">
9+
<b-btn size="sm" @click="viewSrc" variant="success">Component source</b-btn>
10+
</template>
811
<template slot="content">
912

1013
<h1 class="bd-title" id="content">
@@ -15,6 +18,7 @@
1518
</p>
1619

1720
<h2>Examples</h2>
21+
<small class="text-muted">To view this examples source code use edit page button</small>
1822
<br>
1923
<div class="bd-example">
2024
<slot name="demo"></slot>
@@ -103,6 +107,20 @@
103107
};
104108
});
105109
},
110+
githubURL(){
111+
const base = 'https://github.com/bootstrap-vue/bootstrap-vue/tree/master/components';
112+
let component = this.docs.component
113+
.replace(/(?:^|\.?)([A-Z])/g, (x, y) => "-" + y.toLowerCase())
114+
.replace(/^b-/, "");
115+
return base + '/' + component + '.vue';
116+
},
117+
},
118+
119+
methods: {
120+
viewSrc(){
121+
window.open(this.githubURL, '_blank');
122+
this.$ga.event('docs', 'view_source', this.docs.component);
123+
},
106124
},
107125
108126
}

docs/layouts/default.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template>
2-
<nuxt/>
2+
<nuxt/>
33
</template>

docs/layouts/docs.vue

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,23 @@
1717
<m-sidebar></m-sidebar>
1818 8000
</div>
1919
<div class="col-12 col-md-9 pull-md-3 bd-content">
20+
<div class="float-xs-right">
21+
<b-button-group toolbar>
22+
<slot name="actions"></slot>
23+
<b-btn size="sm" @click="issue" variant="warning">‼ Report an issue</b-btn>
24+
<b-btn size="sm" @click="editPage" variant="info">📝️Edit this page</b-btn>
25+
</b-button-group>
26+
</div>
2027
<slot name="content"></slot>
2128
</div>
2229
</div>
2330
</div>
2431

32+
<div class="container">
33+
<div id="disqus_script"></div>
34+
<div id="disqus_thread"></div>
35+
</div>
36+
2537
</layout>
2638
</template>
2739

@@ -30,6 +42,40 @@
3042
import mSidebar from '../includes/sidebar.vue';
3143
3244
export default {
33-
components: {layout, mSidebar}
45+
components: {layout, mSidebar},
46+
data(){
47+
return {}
48+
},
49+
computed: {
50+
github(){
51+
const base = 'https://github.com/bootstrap-vue/bootstrap-vue/tree/master/docs/pages';
52+
let path = window.location.pathname;
53+
if (path.endsWith('/docs') || path.endsWith('/docs/'))
54+
path += '/index';
55+
return base + path + '.vue'
56+
}
57+
},
58+
methods: {
59+
editPage(){
60+
window.open(this.github, '_blank');
61+
this.$ga.event('docs','edit_page');
62+
},
63+
issue(){
64+
window.open('https://github.com/bootstrap-vue/bootstrap-vue/issues/new', '_blank');
65+
this.$ga.event('docs','open_issue');
66+
},
67+
},
68+
mounted(){
69+
70+
if (!document.disqus) {
71+
let script = document.createElement('script');
72+
script.src = '//bootstrap-vue.disqus.com/embed.js';
73+
script.setAttribute('data-timestamp', +new Date());
74+
document.getElementById('disqus_script').appendChild(script);
75+
document.disqus = true;
76+
} else {
77+
DISQUS.reset({reload: true});
78+
}
79+
}
3480
}
3581
</script>

docs/layouts/site.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
2121
export default {
2222
components: {mNav, mFooter},
23+
mounted(){
24+
this.$ga.page(window.location.pathname);
25+
}
2326
}
2427
</script>

nuxt.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = {
66
plugins: [
77
'~plugins/bootstrap-vue.js',
88
'~plugins/highlightjs.js',
9+
'~plugins/ga.js',
910
],
1011
css: [
1112
path.resolve(__dirname, 'node_modules/bootstrap/dist/css/bootstrap-flex.css'),

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"sass-loader": "latest",
8787
"tether": "latest",
8888
"vue": "2.1.7",
89+
"vue-analytics": "latest",
8990
"vue-loader": "latest",
9091
"vue-style-loader": "latest",
9192
"vue-template-compiler": "2.1.7",

0 commit comments

Comments
 (0)
0