From f65a12c2824bed51bd363393780a2a158af18f5e Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Thu, 17 Oct 2019 21:30:20 +0200 Subject: Add chronicle to navbar --- pages/kronika/index.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pages/kronika/index.vue (limited to 'pages/kronika/index.vue') diff --git a/pages/kronika/index.vue b/pages/kronika/index.vue new file mode 100644 index 0000000..4bb6910 --- /dev/null +++ b/pages/kronika/index.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file -- cgit 1.4.1 From ab22672cb9911b7dda59acc4557237b835926816 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sat, 19 Oct 2019 13:49:25 +0200 Subject: Add style to list of posts --- components/ChroniclePost.vue | 60 ++++++++++++++++++++++++ layouts/default.vue | 5 +- pages/kronika/_year/_month/_day/_title/index.vue | 2 +- pages/kronika/index.vue | 40 +++++++++++++++- 4 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 components/ChroniclePost.vue (limited to 'pages/kronika/index.vue') diff --git a/components/ChroniclePost.vue b/components/ChroniclePost.vue new file mode 100644 index 0000000..7b2c527 --- /dev/null +++ b/components/ChroniclePost.vue @@ -0,0 +1,60 @@ + + + + + \ No newline at end of file diff --git a/layouts/default.vue b/layouts/default.vue index 7f9ec5b..496f1ba 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -23,9 +23,10 @@ export default { routes: [ { path: '/', name: 'Strona główna' }, { path: '/download', name: 'Do pobrania' }, - { path: '/kontakt', name: 'Kontakt' } + { path: '/kontakt', name: 'Kontakt' }, + { path: '/kronika', name: 'Kronika' } ], - staticRoutes: [{ path: '/kronika', name: 'Kronika' }], + staticRoutes: [], externalRoutes: [ // { // path: 'https://kronika-puszcza.netlify.com', diff --git a/pages/kronika/_year/_month/_day/_title/index.vue b/pages/kronika/_year/_month/_day/_title/index.vue index 361b7f8..1308eb7 100644 --- a/pages/kronika/_year/_month/_day/_title/index.vue +++ b/pages/kronika/_year/_month/_day/_title/index.vue @@ -7,7 +7,7 @@
-
+
diff --git a/pages/kronika/index.vue b/pages/kronika/index.vue index 4bb6910..f61e615 100644 --- a/pages/kronika/index.vue +++ b/pages/kronika/index.vue @@ -1,18 +1,54 @@ \ No newline at end of file + + + \ No newline at end of file -- cgit 1.4.1 From 6ba5b9968348d0370722972e2763167a8785d8c6 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sat, 19 Oct 2019 14:01:30 +0200 Subject: Fix request path --- pages/kronika/index.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'pages/kronika/index.vue') diff --git a/pages/kronika/index.vue b/pages/kronika/index.vue index f61e615..13322f4 100644 --- a/pages/kronika/index.vue +++ b/pages/kronika/index.vue @@ -17,8 +17,6 @@ import ChroniclePost from '~/components/ChroniclePost' import k from '~/api' -const URL = process.env.DEPLOY_URL || 'http://localhost:8080' - export default { components: { ChroniclePost @@ -34,9 +32,7 @@ export default { methods: { getPosts() { if (this.posts.length < 1) { - this.$axios - .get(`${URL}/api/posts.json`) - .then(r => (this.posts = r.data)) + this.$axios.get(`/api/posts.json`).then(r => (this.posts = r.data)) } console.log(this.posts) } -- cgit 1.4.1 From c52f0ac6ce79a8e1f4342219ad3651b9966b78b2 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sat, 19 Oct 2019 14:20:13 +0200 Subject: Add baseUrl --- nuxt.config.js | 3 +++ pages/kronika/index.vue | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'pages/kronika/index.vue') diff --git a/nuxt.config.js b/nuxt.config.js index 036135b..44a1de3 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -40,6 +40,9 @@ export default { } ] }, + env: { + baseUrl: process.env.DEPLOY_URL || 'http://localhost:3000' + }, generate: { routes: k.getPosts().map(post => post.route) }, diff --git a/pages/kronika/index.vue b/pages/kronika/index.vue index 13322f4..20341e9 100644 --- a/pages/kronika/index.vue +++ b/pages/kronika/index.vue @@ -32,7 +32,9 @@ export default { methods: { getPosts() { if (this.posts.length < 1) { - this.$axios.get(`/api/posts.json`).then(r => (this.posts = r.data)) + this.$axios + .get(`${process.env.baseUrl}/api/posts.json`) + .then(r => (this.posts = r.data)) } console.log(this.posts) } -- cgit 1.4.1 From f45bfe218451d1eb29d18e902b4cb5a41ee12529 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sat, 19 Oct 2019 23:24:05 +0200 Subject: Fix relative axios --- pages/kronika/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pages/kronika/index.vue') diff --git a/pages/kronika/index.vue b/pages/kronika/index.vue index 20341e9..4a89a48 100644 --- a/pages/kronika/index.vue +++ b/pages/kronika/index.vue @@ -33,7 +33,7 @@ export default { getPosts() { if (this.posts.length < 1) { this.$axios - .get(`${process.env.baseUrl}/api/posts.json`) + .get(`${window.location.origin}/api/posts.json`) .then(r => (this.posts = r.data)) } console.log(this.posts) -- cgit 1.4.1