From ee50f163f4dbf449247f835a186f123429000541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8B=BE=E4=B8=89=E8=82=A1=E5=9B=9B?= Date: Mon, 19 Mar 2018 14:30:48 +0800 Subject: [PATCH 1/3] Update serverless-blog.md --- src/v2/cookbook/serverless-blog.md | 38 +++++++++++++----------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/v2/cookbook/serverless-blog.md b/src/v2/cookbook/serverless-blog.md index ff5a767717..646f2e651d 100644 --- a/src/v2/cookbook/serverless-blog.md +++ b/src/v2/cookbook/serverless-blog.md @@ -37,14 +37,14 @@ const butter = Butter('your_api_token'); Using CDN: -```javascript +```html ``` - Import this file into any component you want to use ButterCMS. Then from the console run: +Import this file into any component you want to use ButterCMS. Then from the console run: ```javascript butter.post.list({page: 1, page_size: 10}).then(function(response) { @@ -55,7 +55,8 @@ butter.post.list({page: 1, page_size: 10}).then(function(response) { This API request fetches your blog posts. Your account comes with one example post which you'll see in the response. ## Display posts -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. + +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. 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. @@ -88,7 +89,7 @@ export default new Router({ Then create `components/BlogHome.vue` which will be your blog homepage that lists your most recent posts. -```javascript +```html -Display the result