Skip to content

Commit 7ca5e69

Browse files
committed
chore: clean up some things
1 parent 05069bb commit 7ca5e69

File tree

10 files changed

+12
-37
lines changed

10 files changed

+12
-37
lines changed

.env.example

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

components/TheSidebar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default {
8080
8181
methods: {
8282
notFeatured(id) {
83-
return process.env.FEATURED_ID !== id.toString();
83+
return process.env.FEATURED_CATEGORY_ID !== id.toString();
8484
}
8585
}
8686
};

nuxt.config.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from 'axios';
2+
require('dotenv').config();
23

34
export default {
45
mode: 'universal',
@@ -63,7 +64,7 @@ export default {
6364
generate: {
6465
async routes() {
6566
let posts = await axios
66-
.get('https://wp.kmr.io/wp-json/wp/v2/posts', {
67+
.get(process.env.WORDPRESS_API_URL + '/wp/v2/posts', {
6768
params: { orderby: 'date', per_page: 1000000, _embed: null }
6869
})
6970
.then(res => {
@@ -75,7 +76,7 @@ export default {
7576
});
7677
});
7778
let pages = await axios
78-
.get('https://wp.kmr.io/wp-json/wp/v2/pages', {
79+
.get(process.env.WORDPRESS_API_URL + '/wp/v2/pages', {
7980
params: { orderby: 'date', per_page: 1000000, _embed: null }
8081
})
8182
.then(res => {
@@ -87,7 +88,7 @@ export default {
8788
});
8889
});
8990
let topics = await axios
90-
.get('https://wp.kmr.io/wp-json/wp/v2/categories', { params: { per_page: 1000000 } })
91+
.get(process.env.WORDPRESS_API_URL + '/wp/v2/categories', { params: { per_page: 1000000 } })
9192
.then(res => {
9293
return res.data.map(topic => {
9394
return {
@@ -97,7 +98,7 @@ export default {
9798
});
9899
});
99100
let authors = await axios
100-
.get('https://wp.kmr.io/wp-json/wp/v2/users', { params: { per_page: 1000000 } })
101+
.get(process.env.WORDPRESS_API_URL + '/wp/v2/users', { params: { per_page: 1000000 } })
101102
.then(res => {
102103
return res.data.map(author => {
103104
return {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
},
1515
"dependencies": {
1616
"@nuxtjs/axios": "^5.9.3",
17-
"@nuxtjs/dotenv": "^1.4.1",
1817
"date-fns": "^2.9.0",
1918
"lg-fullscreen.js": "^1.1.0",
2019
"lg-pager.js": "^1.0.0",
@@ -31,6 +30,7 @@
3130
},
3231
"devDependencies": {
3332
"@babel/runtime-corejs3": "^7.8.3",
33+
"@nuxtjs/dotenv": "^1.4.1",
3434
"@nuxtjs/tailwindcss": "^1.3.1",
3535
"@prettier/plugin-php": "^0.12.0",
3636
"consola": "^2.11.3",

pages/README.md

-7
This file was deleted.

pages/authors/_author.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
async asyncData({ app, store, params }) {
3939
if (!store.state.featuredArticles.length) {
4040
let articles = await app.$axios.get(
41-
`${process.env.WORDPRESS_API_URL}/wp/v2/posts?orderby=date&per_page=10&categories=${process.env.FEATURED_ID}&_embed`
41+
`${process.env.WORDPRESS_API_URL}/wp/v2/posts?orderby=date&per_page=10&categories=${process.env.FEATURED_CATEGORY_ID}&_embed`
4242
);
4343
store.commit('setFeaturedArticles', articles.data);
4444
}

pages/index.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default {
5151
computed: {
5252
articlesList() {
5353
return [...this.articles].filter(
54-
article => !article.categories.includes(parseInt(process.env.FEATURED_ID))
54+
article => !article.categories.includes(parseInt(process.env.FEATURED_CATEGORY_ID))
5555
);
5656
}
5757
},
@@ -76,7 +76,7 @@ export default {
7676
params: {
7777
orderby: 'date',
7878
per_page: 10,
79-
categories_exclude: process.env.FEATURED_ID,
79+
categories_exclude: process.env.FEATURED_CATEGORY_ID,
8080
page: this.infiniteLoadingPage + 1,
8181
_embed: true
8282
}

pages/topics/_topic.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
async asyncData({ app, store, params }) {
3939
if (!store.state.featuredArticles.length) {
4040
let articles = await app.$axios.get(
41-
`${process.env.WORDPRESS_API_URL}/wp/v2/posts?orderby=date&per_page=10&categories=${process.env.FEATURED_ID}&_embed`
41+
`${process.env.WORDPRESS_API_URL}/wp/v2/posts?orderby=date&per_page=10&categories=${process.env.FEATURED_CATEGORY_ID}&_embed`
4242
);
4343
store.commit('setFeaturedArticles', articles.data);
4444
}

plugins/README.md

-8
This file was deleted.

static/README.md

-11
This file was deleted.

0 commit comments

Comments
 (0)