You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/v2/cookbook/serverless-blog.md
+36-36Lines changed: 36 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -1,45 +1,45 @@
1
1
---
2
-
title: Create a CMS-Powered Blog
2
+
title: Membuat Blog Bertenaga CMS
3
3
type: cookbook
4
4
order: 5
5
5
---
6
6
7
-
So you've just launched your Vue.js website, congrats! Now you want to add a blog that quickly plugs into your website and you don't want to have to spin up a whole server just to host a Wordpress instance (or any DB-powered CMS for that matter). You want to just be able to add a few Vue.js blog components and some routes and have it all just work, right? What you're looking for is a blog that's powered entirely by API's you can consume directly from your Vue.js application. This tutorial will teach you how to do just that, let's dive in!
7
+
Jadi Anda baru saja meluncurkan website Vue.js Anda, selamat! Sekarang Anda ingin menambahkan sebuah blog yang cepat terhubung ke dalam website Anda dan Anda tidak ingin harus merubah seluruh server hanya untuk menjadi *host*Wordpress *instance* (atau CMS dilengkapi DB untuk hal ini). Anda hanya ingin bisa menambahkan beberapa komponen blog Vue.js dan beberapa rute dan membuatnya berfungsi, bukan? Apa yang Anda cari adalah blog yang sepenuhnya di didukung oleh API yang dapat Anda konsumsi secara langsung dari aplikasi Vue.js Anda. Tutorial ini akan mengajarkan Anda bagaimana melakukannya. Mari menyelaminya.
8
8
9
-
We're going to quickly build a CMS-powered blog with Vue.js. It uses[ButterCMS](https://buttercms.com/), an API-first CMS that lets you manage content using the ButterCMS dashboard and integrate our content API into your Vue.js app. You can use ButterCMS for new or existing Vue.js projects.
9
+
Kita akan membangun dengan cepat sebuah blog bertenaga CMS dengan Vue.js. Ini menggunakan[ButterCMS](https://buttercms.com/), sebuah CMS yang mengutamakan API, yang mengijinkan Anda mengelola konten menggunakan ButterCMS dasbor dan mengintegrasikan API konten ke dalam aplikasi Vue.js Anda. Anda dapat menggunakan ButterCMS untuk proyek Vue.js baru maupun yang sudah ada.
This API request fetches your blog posts. Your account comes with one example post which you'll see in the response.
59
+
Permintaan API ini mengambil pos blog Anda. Akun Anda dilengkapi dengan sebuah contoh pos yang akan Anda lihat di dalam respon.
60
60
61
-
## Display posts
61
+
## Menampilkan pos
62
62
63
-
To display posts we create a `/blog`route (using Vue Router) in our app and fetch blog posts from the Butter API, as well as a `/blog/:slug`route to handle individual posts.
63
+
Untuk menampilkan pos-pos, kita buat sebuah rute `/blog`(menggunakan Vue Router) di dalam aplikasi kita dan mengambil pos blog dari API Butter, serta rute `/blog/:slug`untuk menangani masing-masing pos.
64
64
65
-
See the ButterCMS [API reference](https://buttercms.com/docs/api/?javascript#blog-posts)for additional options such as filtering by category or author. The response also includes some metadata we'll use for pagination.
65
+
Lihat [Referensi API](https://buttercms.com/docs/api/?javascript#blog-posts)ButterCMS untuk opsi tambahan seperti filter berdasar kategori atau penulis. Respon juga termasuk beberapa *metadata* yang akan kita gunakan untuk *pagination*.
66
66
67
67
`router/index.js:`
68
68
@@ -91,7 +91,7 @@ export default new Router({
91
91
})
92
92
```
93
93
94
-
Then create`components/BlogHome.vue`which will be your blog homepage that lists your most recent posts.
94
+
Kemudian buat`components/BlogHome.vue`yang akan menjadi halaman utama blog Anda yang menampilkan daftar pos Anda paling baru.
95
95
96
96
```html
97
97
<script>
@@ -153,11 +153,11 @@ Then create `components/BlogHome.vue` which will be your blog homepage that list
153
153
</template>
154
154
```
155
155
156
-
Here's what it looks like (note we added CSS fromhttps://bulma.io/for quick styling):
156
+
Berikut tampilannya (perhatikan bahwa kita menambahkan CSS darihttps://bulma.io/untuk penataan secara cepat)
Now our app is pulling all blog posts and we can navigate to individual posts. However, our next/previous post buttons are not working.
216
+
Sekarang aplikasi kita menarik semua pos blog dan kita dapat menavigasi ke masing-masing pos. Namun, tombol pos berikutnya/ pos sebelumnya tidak berfungsi
217
217
218
-
One thing to note when using routes with params is that when the user navigates from `/blog/foo`to`/blog/bar`, the same component instance will be reused. Since both routes render the same component, this is more efficient than destroying the old instance and then creating a new one.
218
+
Satu hal yang perlu diperhatikan ketika menggunakan rute dengan parameter adalah ketika pengguna menavigasi dari `/blog/foo`ke`/blog/bar`, komponen yang sama akan digunakan kembali. Karena kedua rute me-*render* komponen yang sama, ini lebih efisien daripada menghancurkan *instance* lama kemudian membuat yang baru.
219
219
220
-
<pclass="tip">Be aware, that using the component this way will mean that the lifecycle hooks of the component will not be called. Visit the Vue Router's docs to learn more about [Dynamic Route Matching](https://router.vuejs.org/en/essentials/dynamic-matching.html)</p>
220
+
<pclass="tip">Perlu dipahami, bahwa menggunakan komponen dengan cara ini berarti bahwa kait siklus hidup komponen tidak akan dipanggil. Kunjungi dokumen Vue Router untuk mempelajari lebih lanjut tentang [Pencocokan Rute Dinamis] (https://router.vuejs.org/en/essentials/dynamic-matching.html)</p>
221
221
222
-
To fix this we need to watch the `$route`object and call `getPost()`when the route changes.
222
+
Untuk memperbaiki ini kita perlu memantau objek `$route`dan memanggil `getPost()`ketika rute berubah.
Here's an example of listing all categories and getting posts by category. Call these methods on the `created()` lifecycle hook:
270
+
Berikut adalah contoh menampilkan daftar semua kategori dan mendapatkan pos berdasar kategori. Panggil method pada kait siklus hidup `created()`:
271
271
272
272
```javascript
273
273
methods: {
@@ -296,10 +296,10 @@ created() {
296
296
}
297
297
```
298
298
299
-
## Alternative Patterns
299
+
## Pola Alternatif
300
300
301
-
An alternative pattern to consider, especially if you prefer writing only in Markdown, is using something like [Nuxtent](https://nuxtent-module.netlify.com/guide/writing/#async-components). Nuxtent allows you to use `Vue Component`inside of Markdown files. This approach would be akin to a static site approach (i.e. Jekyll) where you compose your blog posts in Markdown files. Nuxtent adds a nice integration between Vue.js and Markdown allowing you to live in a 100% Vue.js world.
301
+
Pola alternatif untuk dipertimbangkan, terutama jika Anda lebih suka menulis dengan Markdown, adalah dengan menggunakan sesuatu seperti [Nuxtent](https://nuxtent-module.netlify.com/guide/writing/#async-components). Nuxtent memungkinkan Anda menggunakan `Vue Component`di dalam file Markdown. Pendekatan ini akan mirip dengan pendekatan situs statis (contoh Jekyll) di mana Anda menulis pos blog Anda di dalam file Markdown, Nuxtent menambahkan integrasi yang bagus antara Vue.js dan Markdown memungkinkan Anda untuk hidup di dunia 100% Vue.js.
302
302
303
-
## Wrap up
303
+
## Ringkasan
304
304
305
-
That's it! You now have a fully functional CMS-powered blog running in your app. We hope this tutorial was helpful and made your development experience with Vue.js even more enjoyable :)
305
+
Itulah tutorialnya! Anda sekarang memiliki blog bertenaga CMS yang berfungsi penuh yang berjalan di aplikasi Anda. Kami berharap tutorial ini bermanfaat dan menjadikan pengalaman pengembangan Anda dengan Vue.js semakin menyenangkan :)
0 commit comments