Skip to content

Commit 49c1c98

Browse files
committed
wip: nuxt 2 upgrade
1 parent f03511a commit 49c1c98

36 files changed

+3491
-3252
lines changed

.editorconfig

-13
This file was deleted.

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
WORDPRESS_API_URL=https://wp.kmr.io/wp-json
2+
FEATURED_ID=194

.eslintrc.js

-16
This file was deleted.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ dist
2727
.Trashes
2828
ehthumbs.db
2929
Thumbs.db
30+
31+
.env

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10.18.1

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.nuxt

.prettierrc.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"semi": true,
5+
"useTabs": false,
6+
"jsxBracketSameLine": false,
7+
"arrowParens": "avoid",
8+
"singleQuote": true,
9+
"bracketSpacing": true,
10+
"trailingComma": "none"
11+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## Build Setup
1414

15-
``` bash
15+
```bash
1616
# install dependencies
1717
$ npm install
1818

assets/svg/Smile.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
3-
<path d="M0 0h24v24H0z" fill="none"/>
4-
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"/>
3+
<path d="M0 0h24v24H0z" fill="none" />
4+
<path
5+
d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"
6+
/>
57
</svg>
68
</template>

components/ArticleComments.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="comments">
33
<div class="loading" v-if="!disqusReady">
4-
<Spinner1/>
4+
<Spinner1 />
55
<span>Loading comments</span>
66
</div>
77
<div class="disqus" :class="{ ready: disqusReady }">
@@ -19,8 +19,8 @@
1919
</template>
2020

2121
<script>
22-
import Spinner1 from '~/components/Spinner1'
23-
import VueDisqus from 'vue-disqus/VueDisqus.vue'
22+
import Spinner1 from '~/components/Spinner1';
23+
import VueDisqus from 'vue-disqus/VueDisqus.vue';
2424
2525
export default {
2626
props: {
@@ -30,12 +30,12 @@ export default {
3030
Spinner1,
3131
VueDisqus
3232
},
33-
data () {
33+
data() {
3434
return {
3535
disqusReady: false
36-
}
36+
};
3737
}
38-
}
38+
};
3939
</script>
4040

4141
<style lang="scss" scoped>

components/ArticleFeaturedImage.vue

+9-16
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@
33
<div
44
v-if="featuredImage.source_url"
55
class="featured-image lazy"
6-
:class="{ 'expanded': expanded }"
6+
:class="{ expanded: expanded }"
77
>
8-
<div
9-
class="image-height"
10-
:style="{ paddingTop: featuredImageAspectRatio}"
11-
></div>
12-
<img v-lazy="featuredImage.source_url">
13-
<div
14-
class="featured-image-padding"
15-
:style="{ paddingTop: featuredImageAspectRatio}"
16-
>
17-
</div>
8+
<div class="image-height" :style="{ paddingTop: featuredImageAspectRatio }"></div>
9+
<img v-lazy="featuredImage.source_url" />
10+
<div class="featured-image-padding" :style="{ paddingTop: featuredImageAspectRatio }"></div>
1811
</div>
1912
</div>
2013
</template>
@@ -27,11 +20,11 @@ export default {
2720
},
2821
2922
computed: {
30-
featuredImageAspectRatio () {
31-
return this.featuredImage.height / this.featuredImage.width * 100 + '%'
23+
featuredImageAspectRatio() {
24+
return (this.featuredImage.height / this.featuredImage.width) * 100 + '%';
3225
}
3326
}
34-
}
27+
};
3528
</script>
3629

3730
<style lang="scss" scoped>
@@ -59,7 +52,7 @@ export default {
5952
transition: opacity 0.8s;
6053
width: 100%;
6154
62-
&[lazy="loaded"] {
55+
&[lazy='loaded'] {
6356
opacity: 0.6;
6457
6558
@media (max-width: 900px) {
@@ -69,7 +62,7 @@ export default {
6962
}
7063
7164
&.expanded {
72-
img[lazy="loaded"] {
65+
img[lazy='loaded'] {
7366
opacity: 1;
7467
}
7568
}

components/ArticleList.vue

+22-8
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,32 @@
55
<span v-html="shortTimestamp(article.date)"></span>
66
&nbsp;&nbsp;
77
<span class="topics">
8-
<nuxt-link class="topic fancy" v-for="topic in article._embedded['wp:term'][0]" :to="`/topics/${topic.slug}`" :key="topic.id" v-html="topic.name"></nuxt-link>
8+
<nuxt-link
9+
class="topic fancy"
10+
v-for="topic in article._embedded['wp:term'][0]"
11+
:to="`/topics/${topic.slug}`"
12+
:key="topic.id"
13+
v-html="topic.name"
14+
></nuxt-link>
915
</span>
1016
</div>
1117
<nuxt-link :to="`/${article.slug}`" class="row">
1218
<div class="col">
1319
<div class="lazy thumbnail" v-if="article._embedded['wp:featuredmedia']">
14-
<img v-lazy="article._embedded['wp:featuredmedia'][0].media_details.sizes.thumbnail.source_url">
15-
<Spinner1 class="spinner"/>
20+
<img
21+
v-lazy="
22+
article._embedded['wp:featuredmedia'][0].media_details.sizes.thumbnail.source_url
23+
"
24+
/>
25+
<Spinner1 class="spinner" />
1626
</div>
1727
<div class="lazy medium" v-if="article._embedded['wp:featuredmedia']">
18-
<img v-lazy="article._embedded['wp:featuredmedia'][0].media_details.sizes.medium.source_url">
19-
<Spinner1 class="spinner"/>
28+
<img
29+
v-lazy="
30+
article._embedded['wp:featuredmedia'][0].media_details.sizes.medium.source_url
31+
"
32+
/>
33+
<Spinner1 class="spinner" />
2034
</div>
2135
</div>
2236
<div class="col">
@@ -29,7 +43,7 @@
2943
</template>
3044

3145
<script>
32-
import Spinner1 from '~/components/Spinner1'
46+
import Spinner1 from '~/components/Spinner1';
3347
3448
export default {
3549
components: {
@@ -41,7 +55,7 @@ export default {
4155
mixins: {
4256
shortTimestamp: Function
4357
}
44-
}
58+
};
4559
</script>
4660

4761
<style lang="scss" scoped>
@@ -118,7 +132,7 @@ export default {
118132
.lazy {
119133
margin: 0 22px 0 0;
120134
121-
&.thumbnail {
135+
&.thumbnail {
122136
display: block;
123137
}
124138

components/Spinner1.vue

+12-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
}
1818
}
1919
20-
.double-bounce1, .double-bounce2 {
20+
.double-bounce1,
21+
.double-bounce2 {
2122
width: 100%;
2223
height: 100%;
2324
border-radius: 50%;
@@ -26,24 +27,26 @@
2627
position: absolute;
2728
top: 0;
2829
left: 0;
29-
animation: sk-bounce 2.0s infinite ease-in-out;
30+
animation: sk-bounce 2s infinite ease-in-out;
3031
}
3132
3233
.double-bounce2 {
33-
-webkit-animation-delay: -1.0s;
34-
animation-delay: -1.0s;
34+
-webkit-animation-delay: -1s;
35+
animation-delay: -1s;
3536
}
3637
3738
@keyframes sk-bounce {
38-
0%, 100% {
39-
transform: scale(0.0);
40-
} 50% {
41-
transform: scale(1.0);
39+
0%,
40+
100% {
41+
transform: scale(0);
42+
}
43+
50% {
44+
transform: scale(1);
4245
}
4346
}
4447
4548
.infinite-status-prompt {
46-
color: rgba($primary, .65);
49+
color: rgba($primary, 0.65);
4750
font-size: 0.8rem;
4851
font-family: 'Roboto', sans-serif;
4952
margin: 64px auto;

components/Spinner2.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@
3636
}
3737
3838
@keyframes sk-bouncedelay {
39-
0%, 80%, 100% {
39+
0%,
40+
80%,
41+
100% {
4042
transform: scale(0);
41-
} 40% {
42-
transform: scale(1.0);
43+
}
44+
40% {
45+
transform: scale(1);
4346
}
4447
}
4548
</style>

components/TheFooter.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
<script>
1414
export default {
1515
computed: {
16-
meta () {
17-
return this.$store.state.meta
16+
meta() {
17+
return this.$store.state.meta;
1818
},
19-
year () {
20-
return new Date().getFullYear()
19+
year() {
20+
return new Date().getFullYear();
2121
}
2222
},
2323
2424
mixins: {
2525
homeScrollTop: Function
2626
}
27-
}
27+
};
2828
</script>
2929

3030
<style lang="scss" scoped>
@@ -39,7 +39,7 @@ footer {
3939
flex-direction: column;
4040
height: 200px;
4141
font-family: 'Roboto', sans-serif;
42-
font-size: .7rem;
42+
font-size: 0.7rem;
4343
margin: 0 auto;
4444
max-width: $containerWidth;
4545
padding: 64px 32px;

components/TheHeader.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@
1010
<nuxt-link to="/authors">Authors</nuxt-link>
1111
<nuxt-link to="/pages/sample-page">Sample Page</nuxt-link>
1212
</nav>
13-
<TheHeaderSearch/>
13+
<TheHeaderSearch />
1414
</div>
1515
</header>
1616
</template>
1717

1818
<script>
19-
import TheHeaderSearch from '~/components/TheHeaderSearch'
19+
import TheHeaderSearch from '~/components/TheHeaderSearch';
2020
2121
export default {
2222
components: {
2323
TheHeaderSearch
2424
},
2525
2626
computed: {
27-
meta () {
28-
return this.$store.state.meta
27+
meta() {
28+
return this.$store.state.meta;
2929
}
3030
},
3131
3232
mixins: {
3333
homeScrollTop: Function
3434
}
35-
}
35+
};
3636
</script>
3737

3838
<style lang="scss" scoped>

0 commit comments

Comments
 (0)