Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit 48895303 authored by Seth A Johnson's avatar Seth A Johnson
Browse files

add news pages, list, card

parent b1cff88f
......@@ -36,7 +36,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
return edge
}
})
console.log(pages)
pages.forEach(edge => {
const pathName = edge.node.frontmatter.path || edge.node.fields.slug;
const component = path.resolve(`src/templates/${String(edge.node.frontmatter.templateKey)}.js`);
......
import React from "react"
import {useStaticQuery, graphql} from "gatsby"
import Book from "./book"
import BookCard from "./bookCard"
export const bookQuery = graphql`
query {
......@@ -42,7 +42,7 @@ const BookList = () => {
data.allMarkdownRemark.edges.map(({node}) => {
return (
<div class="col-3">
<Book book={node.frontmatter} />
<BookCard key={node.id} book={node.frontmatter} />
</div>
)
})
......
......@@ -21,7 +21,6 @@ const Navbar = () => {
setNav(isOpen => !isOpen)
}
const data = useStaticQuery(getLogo)
console.log(data)
return (
<nav className="navbar navbar-expand-sm bg-light navbar-light">
......
import React from "react"
import Img from "gatsby-image"
const News = (props) => {
console.log(props.singleNews)
const {title, date, image} = props.singleNews.frontmatter
const html = props.singleNews.html
return (
<article>
<h4>{title}</h4>
<Img fluid={image.childImageSharp.fluid} />
<h6>{date}</h6>
<p dangerouslySetInnerHTML={{ __html: html }} />
</article>
)
}
export default News
import React from "react"
import NewsCard from "./newsCard"
const NewsList = (props) => {
console.log(props)
return (
<section>
{
props.news.map(({node}) => {
return <NewsCard key={node.id} singleNews={node} />
})
}
</section>
)
}
export default NewsList
......@@ -3,7 +3,7 @@ import React from "react"
import Layout from "../components/layout"
import SEO from "../components/seo"
import Title from "../components/title"
import BookList from "../components/book/bookList"
import BookList from "../components/books/bookList"
const IndexPage = () => (
<Layout>
......
import React from "react"
import {graphql} from "gatsby"
import Layout from "../components/layout"
import NewsList from "../components/news/newsList"
const News = ({data}) => {
const news = data.allMarkdownRemark.edges
return (
<Layout>
<NewsList news={news} />
</Layout>
)
}
export const query = graphql`
{
allMarkdownRemark (
filter: {
frontmatter: { templateKey: { eq: "news" } }
}
) {
edges {
node {
html
frontmatter {
title
date(formatString:"MMMM Do, YYYY")
image{
childImageSharp{
fluid{
...GatsbyImageSharpFluid
}
}
}
}
}
}
}
}
`
export default News
import React from 'react'
import Layout from '../components/layout'
export Event = () => {
const Event = () => {
return (
<div>
<Layout>
</div>
</Layout>
)
}
......
......@@ -15,14 +15,14 @@ const Info = ({data}) => {
}
export const query = graphql`
query infoPage($id: String!) {
markdownRemark(id: {eq: $id}) {
html
frontmatter{
title
query infoPage($id: String!) {
markdownRemark(id: {eq: $id}) {
html
frontmatter{
title
}
}
}
}
`
export default Info
import React from 'react'
import Layout from '../components/layout'
import {graphql} from "gatsby"
import Img from "gatsby-image"
const News = ({data}) => {
console.log(data)
const { html } = data.markdownRemark.html
const { title, date, image } = data.markdownRemark.frontmatter
export News = () => {
return (
<div>
</div>
return (
<Layout>
<h1>{title}</h1>
<Img fluid={image.childImageSharp.fluid} />
<h4>{date}</h4>
<p dangerouslySetInnerHTML={{ __html: html }} />
</Layout>
)
}
export const query = graphql`
query ($id: String!) {
markdownRemark(id: {eq: $id}) {
html
frontmatter {
title
date(formatString: "MMMM Do, YYYY")
image {
childImageSharp {
fluid {
...GatsbyImageSharpFluid
}
}
}
}
}
}
`
export default News
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