Skip to content

Commit 83e5924

Browse files
authored
Vuepress 1.0 (sagalbot#843)
* bump vuepress * extend default-theme, implement codefund
1 parent 04b1bfa commit 83e5924

File tree

6 files changed

+838
-1932
lines changed

6 files changed

+838
-1932
lines changed

docs/.vuepress/config.js

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const isDeployPreview = process.env.hasOwnProperty('DEPLOY_PREVIEW');
22

33
const meta = {
44
title: 'Vue Select | VueJS Select2/Chosen Component',
5-
description: 'Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.',
5+
description: 'Everything you wish the HTML &#x3C;select&#x3E; element could do, wrapped up into a lightweight, extensible Vue component.',
66
url: 'http://sagalbot.github.io/vue-select/',
77
icon: '/vue-logo.png',
88
};
@@ -22,44 +22,60 @@ let head = [
2222
rel: 'stylesheet',
2323
type: 'text/css',
2424
}],
25-
['link', { rel: 'icon', href: `/vue-logo.png` }],
26-
['meta', { name: 'theme-color', content: '#3eaf7c' }],
27-
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
28-
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
29-
['link', { rel: 'apple-touch-icon', href: `/icons/apple-touch-icon-152x152.png` }],
30-
['link', { rel: 'mask-icon', href: '/icons/safari-pinned-tab.svg', color: '#3eaf7c' }],
31-
['meta', { name: 'msapplication-TileImage', content: '/icons/msapplication-icon-144x144.png' }],
32-
['meta', { name: 'msapplication-TileColor', content: '#000000' }]
25+
['link', {rel: 'icon', href: `/vue-logo.png`}],
26+
['meta', {name: 'theme-color', content: '#3eaf7c'}],
27+
['meta', {name: 'apple-mobile-web-app-capable', content: 'yes'}],
28+
['meta', {name: 'apple-mobile-web-app-status-bar-style', content: 'black'}],
29+
[
30+
'link',
31+
{rel: 'apple-touch-icon', href: `/icons/apple-touch-icon-152x152.png`}],
32+
[
33+
'link',
34+
{rel: 'mask-icon', href: '/icons/safari-pinned-tab.svg', color: '#3eaf7c'}],
35+
[
36+
'meta',
37+
{
38+
name: 'msapplication-TileImage',
39+
content: '/icons/msapplication-icon-144x144.png',
40+
}],
41+
['meta', {name: 'msapplication-TileColor', content: '#000000'}],
42+
['meta', {name: 'title', content: meta.title}],
43+
['meta', {name: 'description', content: meta.description}],
44+
['link', {rel: 'icon', href: meta.icon, type: 'image/png'}],
45+
['meta', {property: 'og:image', content: meta.icon}],
46+
['meta', {property: 'twitter:image', content: meta.icon}],
47+
['meta', {name: 'description', content: meta.description}],
48+
['meta', {property: 'og:description', content: ''}],
49+
['meta', {property: 'twitter:description', content: meta.description}],
50+
['meta', {property: 'twitter:title', content: meta.title}],
51+
['meta', {property: 'og:title', content: meta.title}],
52+
['meta', {property: 'og:site_name', content: meta.title}],
53+
['meta', {property: 'og:url', content: meta.url}],
3354
];
3455

3556
if (isDeployPreview) {
3657
head.push(
3758
['meta', {name: 'robots', content: 'noindex'}],
3859
['meta', {name: 'googlebot', content: 'noindex'}],
3960
);
40-
} else {
41-
head.push(
42-
['meta', {name: 'title', content: meta.title}],
43-
['meta', {name: 'description', content: meta.description}],
44-
['link', {rel: 'icon', href: meta.icon, type: 'image/png'}],
45-
['meta', {property: 'og:image', content: meta.icon}],
46-
['meta', {property: 'twitter:image', content: meta.icon}],
47-
['meta', {name: 'description', content: meta.description}],
48-
['meta', {property: 'og:description', content: ''}],
49-
['meta', {property: 'twitter:description', content: meta.description}],
50-
['meta', {property: 'twitter:title', content: meta.title}],
51-
['meta', {property: 'og:title', content: meta.title}],
52-
['meta', {property: 'og:site_name', content: meta.title}],
53-
['meta', {property: 'og:url', content: meta.url}],
54-
);
5561
}
5662

5763
module.exports = {
5864
title: 'Vue Select',
5965
description: meta.description,
6066
head,
61-
serviceWorker: !isDeployPreview,
62-
ga: isDeployPreview ? '' : 'UA-12818324-8',
67+
plugins: {
68+
'@vuepress/google-analytics': {
69+
ga: isDeployPreview ? '' : 'UA-12818324-8',
70+
},
71+
'@vuepress/pwa': {
72+
serviceWorker: true,
73+
updatePopup: {
74+
message: 'New content is available.',
75+
buttonText: 'Refresh',
76+
},
77+
},
78+
},
6379
themeConfig: {
6480
repo: 'sagalbot/vue-select',
6581
editLinks: true,
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<script>
2+
export default {
3+
render (h) {
4+
return h('div', {attrs: {id: 'codefund'}});
5+
},
6+
mounted () {
7+
this.load();
8+
},
9+
watch: {
10+
'$route' (to, from) {
11+
if (
12+
to.path !== from.path
13+
// Only reload if the ad has been loaded
14+
// otherwise it's possible that the script is appended but
15+
// the ads are not loaded yet. This would result in duplicated ads.
16+
&& this.$el.querySelector('#cf')
17+
) {
18+
this.$el.innerHTML = '';
19+
this.load();
20+
}
21+
},
22+
},
23+
methods: {
24+
load () {
25+
26+
// const template = 'default';
27+
// const template = 'vertical';
28+
// const template = 'float-with-close';
29+
// const template = 'image-only';
30+
// const template = 'image-centered';
31+
// const template = 'square';
32+
const template = 'centered';
33+
// const template = 'bottom-bar';
34+
35+
const s = document.createElement('script');
36+
s.id = '_codefund_js';
37+
s.src = `//codefund.app/properties/193/funder.js?template=${template}`;
38+
s.async = 'async';
39+
this.$el.appendChild(s);
40+
},
41+
},
42+
};
43+
</script>

docs/.vuepress/theme/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extend: '@vuepress/theme-default',
3+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<ParentLayout>
3+
<CodeFund slot="sidebar-top"/>
4+
</ParentLayout>
5+
</template>
6+
7+
<script>
8+
import ParentLayout from '@parent-theme/layouts/Layout.vue'
9+
import CodeFund from '../components/CodeFund.vue'
10+
11+
export default {
12+
components: {
13+
ParentLayout,
14+
CodeFund
15+
}
16+
}
17+
</script>
18+
19+
<style>
20+
#codefund {
21+
border-bottom: 1px solid #eaecef;
22+
min-height: 115px;
23+
}
24+
#codefund + .sidebar-links {
25+
padding-top: 1rem;
26+
}
27+
</style>

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
"@babel/preset-env": "^7.4.2",
3131
"@babel/runtime": "^7.4.2",
3232
"@vue/test-utils": "^1.0.0-beta.29",
33+
"@vuepress/plugin-google-analytics": "^1.0.0-alpha.47",
34+
"@vuepress/plugin-pwa": "^1.0.0-alpha.47",
3335
"autoprefixer": "^9.4.7",
3436
"babel-core": "^7.0.0-bridge.0",
3537
"babel-loader": "^8.0.5",
@@ -59,7 +61,7 @@
5961
"vue-server-renderer": "^2.6.10",
6062
"vue-style-loader": "^4.1.2",
6163
"vue-template-compiler": "^2.6.10",
62-
"vuepress": "^0.14.10",
64+
"vuepress": "^1.0.0-alpha.47",
6365
"vuex": "^3.1.0",
6466
"webpack": "^4.29.6",
6567
"webpack-cli": "^3.3.0",

0 commit comments

Comments
 (0)