Commit 0461f595 authored by Seth A Johnson's avatar Seth A Johnson
Browse files

add homepage markdown for tagline

parent fd9e326e
...@@ -27,9 +27,12 @@ exports.createPages = async ({ actions, graphql, reporter }) => { ...@@ -27,9 +27,12 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
return return
} }
// filter out books, we don't make pages for those // Filter out books, we don't make pages for those
// Also the home-page, or index.js. It just has pieces of content,
// not a generated page.
pages = results.data.allMarkdownRemark.edges.filter(edge => { pages = results.data.allMarkdownRemark.edges.filter(edge => {
if (edge.node.frontmatter.templateKey === "book") { if (edge.node.frontmatter.templateKey === "book" ||
edge.node.frontmatter.templateKey === "home-page") {
return false return false
} else { } else {
return edge return edge
...@@ -38,7 +41,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => { ...@@ -38,7 +41,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
pages.forEach(edge => { pages.forEach(edge => {
const pathName = edge.node.frontmatter.path || edge.node.fields.slug; const pathName = edge.node.frontmatter.path || edge.node.fields.slug;
console.log(pathName);
const component = path.resolve(`src/templates/${String(edge.node.frontmatter.templateKey)}.js`); const component = path.resolve(`src/templates/${String(edge.node.frontmatter.templateKey)}.js`);
const id = edge.node.id const id = edge.node.id
createPage({ createPage({
......
...@@ -5,7 +5,6 @@ const Book = ({book}) => { ...@@ -5,7 +5,6 @@ const Book = ({book}) => {
const { const {
title, title,
author, author,
description,
readLink, readLink,
buyLink, buyLink,
cover cover
...@@ -20,7 +19,6 @@ const Book = ({book}) => { ...@@ -20,7 +19,6 @@ const Book = ({book}) => {
<div className="card-body"> <div className="card-body">
<h5 className="card-title">{title}</h5> <h5 className="card-title">{title}</h5>
<h5 className="card-title">{author}</h5> <h5 className="card-title">{author}</h5>
{/* <p className="card-text">{description}</p> */}
<a className="card-link" href={readLink}>Read</a> <a className="card-link" href={readLink}>Read</a>
<a className="card-link" href={buyLink}>Buy</a> <a className="card-link" href={buyLink}>Buy</a>
</div> </div>
......
...@@ -3,12 +3,11 @@ import {graphql, useStaticQuery, Link} from 'gatsby' ...@@ -3,12 +3,11 @@ import {graphql, useStaticQuery, Link} from 'gatsby'
export const titleQuery = graphql` export const titleQuery = graphql`
{ {
site { site {
siteMetadata { siteMetadata {
title title
}
} }
}
} }
` `
...@@ -21,7 +20,7 @@ const Footer = () => { ...@@ -21,7 +20,7 @@ const Footer = () => {
<ul className="lever-footer-links"> <ul className="lever-footer-links">
<li> <li>
<Link to="/"> <Link to="/">
Lever Press {title}
</Link> </Link>
</li> </li>
</ul> </ul>
......
---
templateKey: home-page
---
...@@ -2,18 +2,31 @@ import React from "react" ...@@ -2,18 +2,31 @@ import React from "react"
import Layout from "../components/layout" import Layout from "../components/layout"
import SEO from "../components/seo" import SEO from "../components/seo"
import Title from "../components/title"
import BookList from "../components/books/bookList" import BookList from "../components/books/bookList"
import {graphql} from "gatsby"
const IndexPage = () => ( export const IndexQuery = graphql`
<Layout> {
<SEO title="Home" /> content: markdownRemark(frontmatter: { templateKey: { eq: "home-page" } }) {
<div className="index-grid"> frontmatter{
<div className="books"> templateKey
<BookList /> }
}
}
`
const IndexPage = ({data}) => {
return (
<Layout>
<SEO title="Home" />
<div className="index-grid">
<div className="books">
<BookList />
</div>
</div> </div>
</div> </Layout>
</Layout> )
) }
export default IndexPage export default IndexPage
...@@ -49,6 +49,16 @@ collections: ...@@ -49,6 +49,16 @@ collections:
- name: pages - name: pages
label: Pages label: Pages
files: files:
- file: src/content/home.md
name: home
label: Home
fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: home-page }
- name: tagline_section
label: "Tag Line Section"
widget: object
fields:
- { name: text, label: Text, widget: markdown }
- file: "src/content/about.md" - file: "src/content/about.md"
name: about name: about
label: About label: About
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment