Change frontmatter fields

This commit is contained in:
alxshelepenok 2018-11-11 19:32:51 +03:00
parent de05e137ba
commit 440d4e88c7
19 changed files with 26 additions and 26 deletions

View File

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

View File

@ -1,7 +1,7 @@
---
title: "About me"
layout: page
path: "/about"
slug: "/about"
template: "page"
---
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante.

View File

Before

Width:  |  Height:  |  Size: 721 KiB

After

Width:  |  Height:  |  Size: 721 KiB

View File

@ -1,7 +1,7 @@
---
title: "Contact me"
layout: page
path: "/contact"
slug: "/contact"
template: "page"
---
Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

View File

@ -1,9 +1,9 @@
---
title: Perfecting the Art of Perfection
date: "2016-09-01T23:46:37.121Z"
layout: post
template: "post"
draft: false
path: "/posts/perfecting-the-art-of-perfection/"
slug: "/posts/perfecting-the-art-of-perfection/"
category: "Design Inspiration"
tags:
- "Handwriting"

View File

@ -1,9 +1,9 @@
---
title: The Origins of Social Stationery Lettering
date: "2016-12-01T22:40:32.169Z"
layout: post
template: "post"
draft: false
path: "/posts/the-origins-of-social-stationery-lettering"
slug: "/posts/the-origins-of-social-stationery-lettering"
category: "Design Culture"
tags:
- "Typefaces"

View File

@ -1,9 +1,9 @@
---
title: "A Brief History of Typography"
date: "2016-02-02T22:40:32.169Z"
layout: post
template: "post"
draft: false
path: "/posts/a-brief-history-of-typography/"
slug: "/posts/a-brief-history-of-typography/"
category: "Design Inspiration"
tags:
- "Linotype"

View File

@ -1,9 +1,9 @@
---
title: "Johannes Gutenberg: The Birth of Movable Type"
date: "2017-08-18T22:12:03.284Z"
layout: post
template: "post"
draft: false
path: "/posts/the-birth-of-movable-type/"
slug: "/posts/the-birth-of-movable-type/"
category: "Typography"
tags:
- "Open source"

View File

@ -1,9 +1,9 @@
---
title: Humane Typography in the Digital Age
date: "2017-08-19T22:40:32.169Z"
layout: post
template: "post"
draft: false
path: "/posts/humane-typography-in-the-digital-age/"
slug: "/posts/humane-typography-in-the-digital-age/"
category: "Typography"
tags:
- "Design"

View File

@ -36,7 +36,7 @@ const createPages = async ({ graphql, actions }) => {
edges {
node {
frontmatter {
layout
template
}
fields {
slug
@ -50,13 +50,13 @@ const createPages = async ({ graphql, actions }) => {
const { edges } = result.data.allMarkdownRemark;
_.each(edges, (edge) => {
if (_.get(edge, 'node.frontmatter.layout') === 'page') {
if (_.get(edge, 'node.frontmatter.template') === 'page') {
createPage({
path: edge.node.fields.slug,
component: path.resolve('./src/templates/page-template.js'),
context: { slug: edge.node.fields.slug }
});
} else if (_.get(edge, 'node.frontmatter.layout') === 'post') {
} else if (_.get(edge, 'node.frontmatter.template') === 'post') {
createPage({
path: edge.node.fields.slug,
component: path.resolve('./src/templates/post-template.js'),

View File

@ -14,7 +14,7 @@ const onCreateNode = ({ node, actions, getNode }) => {
createNodeField({
node,
name: 'slug',
value: node.frontmatter.path
value: node.frontmatter.slug
});
} else {
const value = createFilePath({ node, getNode });

View File

@ -11,7 +11,7 @@ module.exports = async (graphql, actions) => {
const result = await graphql(`
{
allMarkdownRemark(
filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } }
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
) {
group(field: frontmatter___category) {
fieldValue

View File

@ -9,7 +9,7 @@ module.exports = async (graphql, actions) => {
const result = await graphql(`
{
allMarkdownRemark(
filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } }
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
) { totalCount }
}
`);

View File

@ -11,7 +11,7 @@ module.exports = async (graphql, actions) => {
const result = await graphql(`
{
allMarkdownRemark(
filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } }
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
) {
group(field: frontmatter___tags) {
fieldValue

View File

@ -40,7 +40,7 @@ export const query = graphql`
}
}
allMarkdownRemark(
filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } }
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
) {
group(field: frontmatter___category) {
fieldValue

View File

@ -51,7 +51,7 @@ export const query = graphql`
allMarkdownRemark(
limit: $postsLimit,
skip: $postsOffset,
filter: { frontmatter: { category: { eq: $category }, layout: { eq: "post" }, draft: { ne: true } } },
filter: { frontmatter: { category: { eq: $category }, template: { eq: "post" }, draft: { ne: true } } },
sort: { order: DESC, fields: [frontmatter___date] }
){
edges {

View File

@ -50,7 +50,7 @@ export const query = graphql`
allMarkdownRemark(
limit: $postsLimit,
skip: $postsOffset,
filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } },
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } },
sort: { order: DESC, fields: [frontmatter___date] }
){
edges {

View File

@ -51,7 +51,7 @@ export const query = graphql`
allMarkdownRemark(
limit: $postsLimit,
skip: $postsOffset,
filter: { frontmatter: { tags: { in: [$tag] }, layout: { eq: "post" }, draft: { ne: true } } },
filter: { frontmatter: { tags: { in: [$tag] }, template: { eq: "post" }, draft: { ne: true } } },
sort: { order: DESC, fields: [frontmatter___date] }
){
edges {

View File

@ -39,7 +39,7 @@ export const query = graphql`
}
}
allMarkdownRemark(
filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } }
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
) {
group(field: frontmatter___tags) {
fieldValue