File tree 22 files changed +9134
-12322
lines changed
22 files changed +9134
-12322
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ root : true ,
3
+ env : {
4
+ browser : true ,
5
+ node : true ,
6
+ } ,
7
+ parserOptions : {
8
+ parser : 'babel-eslint' ,
9
+ } ,
10
+ extends : [
11
+ '@nuxtjs' ,
12
+ 'prettier' ,
13
+ 'prettier/vue' ,
14
+ 'plugin:prettier/recommended' ,
15
+ 'plugin:nuxt/recommended' ,
16
+ ] ,
17
+ plugins : [ 'prettier' ] ,
18
+ // add your custom rules here
19
+ rules : {
20
+ 'vue/no-v-html' : 'off' ,
21
+ } ,
22
+ } ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true
4
+ }
Original file line number Diff line number Diff line change 1
- # blog
2
-
3
- > microCMS blog
1
+ # microcms-blog
4
2
5
3
## Build Setup
6
4
7
- ``` bash
5
+ ``` bash
8
6
# install dependencies
9
- $ yarn install
7
+ $ npm install
10
8
11
9
# serve with hot reload at localhost:3000
12
- $ yarn dev
10
+ $ npm run dev
13
11
14
12
# build for production and launch server
15
- $ yarn build
16
- $ yarn start
13
+ $ npm run build
14
+ $ npm run start
17
15
18
16
# generate static project
19
- $ yarn generate
17
+ $ npm run generate
20
18
```
21
19
22
20
For detailed explanation on how things work, check out [ Nuxt.js docs] ( https://nuxtjs.org ) .
Original file line number Diff line number Diff line change 4
4
<nuxt-link to =" /" >記事一覧</nuxt-link >
5
5
</li >
6
6
<li v-if =" category !== undefined" class =" breadcrumbList" >
7
- <nuxt-link v-bind :to =" `/category/${category.id}/page/1`" >{{
7
+ <nuxt-link :to =" `/category/${category.id}/page/1`" >{{
8
8
category.name
9
9
}}</nuxt-link >
10
10
</li >
13
13
14
14
<script >
15
15
export default {
16
- props: [' category' ]
16
+ props: {
17
+ category: {
18
+ type: Object ,
19
+ required: false ,
20
+ default : () => ({}),
21
+ },
22
+ },
17
23
};
18
24
</script >
19
25
Original file line number Diff line number Diff line change 3
3
<h1 class =" pageTitle" >カテゴリー</h1 >
4
4
<ul >
5
5
<li v-for =" category in categories" :key =" category.id" class =" list" >
6
- <nuxt-link v-bind :to =" `/category/${category.id}/page/1`" class =" link" >{{
6
+ <nuxt-link :to =" `/category/${category.id}/page/1`" class =" link" >{{
7
7
category.name
8
8
}}</nuxt-link >
9
9
</li >
12
12
</template >
13
13
14
14
<script >
15
- import axios from ' axios' ;
16
15
export default {
17
- props: [' categories' ]
16
+ props: {
17
+ categories: {
18
+ type: Array ,
19
+ required: false ,
20
+ default : () => [],
21
+ },
22
+ },
18
23
};
19
24
</script >
20
25
Original file line number Diff line number Diff line change 11
11
</button >
12
12
<div v-if =" open" class =" mask" @click =" setOpen(false)" ></div >
13
13
14
- <div class =" menu" :class =" {' isOpen' : open}" >
14
+ <div class =" menu" :class =" { isOpen: open }" >
15
15
<ul class =" lists" >
16
16
<li class =" list" >
17
17
<a href =" https://microcms.io/pricing" >料金</a >
31
31
<a class =" signin" href =" https://app.microcms.io/signin" >ログイン</a >
32
32
</li >
33
33
<li class =" list" >
34
- <a class =" signup" v-bind:href =" `https://app.microcms.io${params}`" >新規登録</a >
34
+ <a class =" signup" :href =" `https://app.microcms.io${params}`"
35
+ >新規登録</a
36
+ >
35
37
</li >
36
38
</ul >
37
39
</div >
42
44
43
45
<script >
44
46
export default {
45
- props: [' isWhite' ],
46
47
data () {
47
48
return {
48
49
params: this .params || ' ' ,
49
- open: false
50
+ open: false ,
50
51
};
51
52
},
52
53
mounted () {
@@ -58,8 +59,8 @@ export default {
58
59
},
59
60
toggleOpen () {
60
61
this .open = ! this .open ;
61
- }
62
- }
62
+ },
63
+ },
63
64
};
64
65
</script >
65
66
Original file line number Diff line number Diff line change 3
3
<h1 class =" pageTitle" >最新の記事</h1 >
4
4
<ul >
5
5
<li v-for =" content in contents" :key =" content.id" class =" list" >
6
- <nuxt-link v-bind :to =" `/${content.id}`" class =" link" >
6
+ <nuxt-link :to =" `/${content.id}`" class =" link" >
7
7
<dl class =" content" >
8
8
<dt class =" title" >{{ content.title }}</dt >
9
- <dd >
10
- <Meta :createdAt =" content.createdAt" :author =" content.author" />
11
- </dd >
12
9
</dl >
13
10
</nuxt-link >
14
11
</li >
17
14
</template >
18
15
19
16
<script >
20
- import axios from ' axios' ;
21
17
export default {
22
- props: [' contents' ]
18
+ props: {
19
+ contents: {
20
+ type: Array ,
21
+ required: false ,
22
+ default : () => [],
23
+ },
24
+ },
23
25
};
24
26
</script >
25
27
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <svg
3
+ class =" NuxtLogo"
4
+ width =" 245"
5
+ height =" 180"
6
+ viewBox =" 0 0 452 342"
7
+ xmlns =" http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d =" M139 330l-1-2c-2-4-2-8-1-13H29L189 31l67 121 22-16-67-121c-1-2-9-14-22-14-6 0-15 2-22 15L5 303c-1 3-8 16-2 27 4 6 10 12 24 12h136c-14 0-21-6-24-12z"
11
+ fill =" #00C58E"
12
+ />
13
+ <path
14
+ d =" M447 304L317 70c-2-2-9-15-22-15-6 0-15 3-22 15l-17 28v54l39-67 129 230h-49a23 23 0 0 1-2 14l-1 1c-6 11-21 12-23 12h76c3 0 17-1 24-12 3-5 5-14-2-26z"
15
+ fill =" #108775"
16
+ />
17
+ <path
18
+ d =" M376 330v-1l1-2c1-4 2-8 1-12l-4-12-102-178-15-27h-1l-15 27-102 178-4 12a24 24 0 0 0 2 15c4 6 10 12 24 12h190c3 0 18-1 25-12zM256 152l93 163H163l93-163z"
19
+ fill =" #2F495E"
20
+ />
21
+ </svg >
22
+ </template >
23
+
24
+ <style >
25
+ .NuxtLogo {
26
+ animation : 1s appear;
27
+ margin : auto ;
28
+ }
29
+
30
+ @keyframes appear {
31
+ 0% {
32
+ opacity : 0 ;
33
+ }
34
+ }
35
+ </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
- <span class =" category" v-if =" category" >{{ category.name }}</span >
3
+ <span v-if =" category" class =" category" >{{ category.name }}</span >
4
4
<div class =" meta" >
5
5
<span class =" timestamp" >
6
6
<img src =" /blog/images/icon_clock.svg" alt />
16
16
17
17
<script >
18
18
export default {
19
- props: [' createdAt' , ' author' , ' category' ]
19
+ props: {
20
+ createdAt: {
21
+ type: String ,
22
+ required: true ,
23
+ },
24
+ author: {
25
+ type: String ,
26
+ required: false ,
27
+ default: undefined ,
28
+ },
29
+ category: {
30
+ type: Object ,
31
+ required: false ,
32
+ default: undefined ,
33
+ },
34
+ },
20
35
};
21
36
</script >
22
37
Original file line number Diff line number Diff line change 4
4
5
5
<script >
6
6
export default {
7
- props: [' body' ]
7
+ props: {
8
+ body: {
9
+ type: String ,
10
+ required: true ,
11
+ default: ' ' ,
12
+ },
13
+ },
8
14
};
9
15
</script >
10
16
Original file line number Diff line number Diff line change 3
3
<h2 class =" pageTitle" >関連記事</h2 >
4
4
<ul class =" lists" >
5
5
<li v-for =" blog in blogs" :key =" blog.id" class =" list" >
6
- <nuxt-link v-bind :to =" `/${blog.id}`" class =" link" >
6
+ <nuxt-link :to =" `/${blog.id}`" class =" link" >
7
7
<picture >
8
8
<source
9
9
type =" image/webp"
15
15
<dt class =" title" >{{ blog.title }}</dt >
16
16
<dd >
17
17
<Meta
18
- :createdAt =" blog.createdAt"
18
+ :created-at =" blog.createdAt"
19
19
:author =" blog.writer.name"
20
20
:category =" blog.category"
21
21
/>
28
28
</template >
29
29
30
30
<script >
31
- import axios from ' axios' ;
32
31
import Meta from ' ~/components/Meta.vue' ;
33
32
export default {
34
- props: [' blogs' ],
35
33
components: {
36
- Meta
37
- }
34
+ Meta,
35
+ },
36
+ props: {
37
+ blogs: {
38
+ type: Array ,
39
+ required: false ,
40
+ default : () => [],
41
+ },
42
+ },
38
43
};
39
44
</script >
40
45
Original file line number Diff line number Diff line change 2
2
<div v-if =" visible" class =" wrapper" >
3
3
<h4 class =" title" >目次</h4 >
4
4
<ul class =" lists" >
5
- <li :class = " `list ${item.name}` " v-for =" item in toc" :key =" item.id" >
5
+ <li v-for =" item in toc" :key =" item.id" :class = " `list ${item.name}` " >
6
6
<n-link v-scroll-to =" `#${item.id}`" to >
7
7
{{ item.text }}
8
8
</n-link >
13
13
14
14
<script >
15
15
export default {
16
- props: [' toc' , ' id' , ' visible' ]
16
+ props: {
17
+ toc: {
18
+ type: Array ,
19
+ required: true ,
20
+ default : () => [],
21
+ },
22
+ visible: {
23
+ type: Boolean ,
24
+ required: false ,
25
+ default: false ,
26
+ },
27
+ },
17
28
};
18
29
</script >
19
30
Original file line number Diff line number Diff line change 2
2
<div class =" wrapper" >
3
3
<h2 class =" title" >ABOUT ME</h2 >
4
4
<div class =" container" >
5
- <img :src =" writer.image.url + '?fit=crop&w=100&h=100&q=100'" class =" image" alt />
5
+ <img
6
+ :src =" writer.image.url + '?fit=crop&w=100&h=100&q=100'"
7
+ class =" image"
8
+ alt
9
+ />
6
10
<dl class =" content" >
7
11
<dt class =" name" >
8
12
{{ writer.name }}
9
- <a class =" twitterLink" v-bind:href =" `https://twitter.com/${writer.id}`" >
10
- <img class =" twitter" src =" /blog/images/icon_twitter.svg" alt =" Twitter" />
13
+ <a class =" twitterLink" :href =" `https://twitter.com/${writer.id}`" >
14
+ <img
15
+ class =" twitter"
16
+ src =" /blog/images/icon_twitter.svg"
17
+ alt =" Twitter"
18
+ />
11
19
</a >
12
20
</dt >
13
21
<dd class =" text" >{{ writer.text }}</dd >
18
26
19
27
<script >
20
28
export default {
21
- props: [' writer' ]
29
+ props: {
30
+ writer: {
31
+ type: Object ,
32
+ required: true ,
33
+ default : () => ({}),
34
+ },
35
+ },
22
36
};
23
37
</script >
24
38
You can’t perform that action at this time.
0 commit comments