I did not find JAMstack generated by GridSome and MicroCMS.
Then, I wanted for make it myself and created this repository.
Please tell me what you notice.
Latest view site: https://feature.codehack.dev
OK
OK
Just did it
Now developing
Now developing
Now developing
This behavior by webpack.config.js. This is because the CSS file is statically read and used like a general site like WordPress, other static site. In other words to edit CSS, edit the scss file placed in the assets directory. Include files are excluded from the multi-compilation export target, but are reflected in the include source CSS.
General websites should be dynamic generate to page at post type single page. If you didn't they config you'll be create all each post page. It is no good. How do you if your post is over 100+ counts at someday because? All right. It config is exsit here. "gridsome.config.js" Reference: https://gridsome.org/docs/templates/
"Compile each SCSS file", This function did must completed to before run gridsome server. Then, they must be watch always at after completed function. Separeted sequence each behavior for it but commands is one, "npm run dev".
Prerequisite: Pass MicroCMS submission data to GraphQL with gridsome.server.js. The actual example is shown below.
<page-query>
query {
allWorks {
edges {
node {
id
title
slug
date (format: "YYYY年MM月DD日 HH:mm:ss")
content
path
}
}
}
}
<page-query>
If the endpoint name is “works”, it will be “allWorks”.
<page-query>
query {
allHome {
edges {
node {
id
title
date
introduce {
intro_title
intro_content
intro_image {
url
}
}
hero {
url
}
carousel {
id
carousel {
url
}
}
feature {
feature_title
feature_image {
url
}
feature_content
}
}
}
}
}
</page-query>
If the endpoint name is “home”, it will be “allHomes”. Note that if the input field created on the MicroCMS side is a multiple content reference type, it will be an array when called.
<table>
<tr v-for="item in $page.allWorks.edges" :key="item.node.permalink" class="works-post__list">
<td>{{ item.node.id }}</td>
<td>{{ item.node.title }}</td>
<td>{{ item.node.slug }}</td>
<td>{{ item.node.date }}</td>
<td v-html="item.node.content"></td>
<td><g-link :to="item.node.path">{{ item.node.path }}</g-link></td>
</tr>
</table>
{{ $page.allHome.edges[0].node.title }}
Here: gridsome.server.js : "Import to GraphQL from MicroCMS."
Refblog: Import and display the post acquired by MicroCMS into GraphQL of GridSome
Here: "/src/templates/WorksPost.vue" : "<page-query> ~ </page-query>"
Here: support@codehack.dev Please tell me what you notice. GOODEV XD