Commit 32613a63 authored by Jonathan McGlone's avatar Jonathan McGlone
Browse files

add support for community post page

parent d2a4fa38
import React from "react"
import {Link} from "gatsby"
const CommunityCard = ({singleCommunity, cardStyle}) => {
const {title, summary, date} = singleCommunity.frontmatter
const slug = singleCommunity.fields.slug
return (
<div className="blog-card-container">
<Link to={slug}>
<div className="card mb-3">
<div className="row no-gutters">
<div className="col-md-8">
<div className="card-body">
<h5 className="card-title">{title}</h5>
<p className="card-text">{summary}</p>
<p className="published"><small className="text-muted">Published {date}</small></p>
</div>
</div>
</div>
</div>
</Link>
</div>
)
}
export default CommunityCard
import React from "react"
import CommunityCard from "./communityCard"
const CommunityList = ({community, cardStyle}) => {
return (
<section className="blog-card-list">
{
community.map(({node}) => {
return <CommunityCard key={node.id} singleCommunity={node} cardStyle={cardStyle}/>
})
}
</section>
)
}
export default CommunityList
......@@ -314,6 +314,9 @@ p.social {
fill: $amherst-brand-color;
}
}
a:first-of-type {
padding-left: 1em;
}
}
// footer
......@@ -340,6 +343,9 @@ p.social {
fill: $amherst-light-blue;
}
}
a:first-of-type {
padding-left: 0;
}
}
}
......
---
templateKey: community-page
title: 'Amherst College Campus & Community '
---
Amherst College Press is proud to participate in the life and community at Amherst College and the greater Pioneer Valley. We are particularly invested in raising awareness about open access and working towards more inclusive scholarly publishing practices. And we are always eager to partner with organizations, community groups, and colleagues at other academic and public libraries. Reach out to us if you would like to learn more about open access humanities book publishing, to request a publishing workshop on your campus, or to simply say hi.
As one of the only university presses based at a liberal arts college, Amherst College Press is committed to developing opportunities for Amherst College undergraduates to become involved in the work of the press. Read more about the Amherst College Press internship program here.
Below you'll find resources created by our interns, including blog posts, book lists, author interviews, and more.
\ No newline at end of file
---
templateKey: community
title: Community Post
summary: Placeholder for a community post with content
date: 2020-10-14T01:06:03.352Z
---
This is a placeholder for the first community post.
\ No newline at end of file
import React from "react"
import {graphql} from "gatsby"
import SEO from "../components/seo"
import Layout from "../components/layout"
import CommunityList from "../components/community/communityList"
const Community = ({data}) => {
const community = data.allMarkdownRemark.edges
return (
<Layout>
<SEO title="Community" />
<div className="container page-container">
<div className="row text-right">
<div className="col-md-12">
<p className="social scala-sans">Connect with us <a href="https://www.instagram.com/amherstcollegepress/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" classname="social-link fb" aria-hidden="false"><title>Instagram</title><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"></path></svg></a>
<a href="http://www.twitter.com/AmCollPress"><svg width="24px" height="24px" viewBox="0 0 24 24" className="social-link tw" aria-hidden="false"><title>Twitter</title><path d="M22,5.8a8.6,8.6,0,0,1-2.36.65,4.07,4.07,0,0,0,1.8-2.27,8.1,8.1,0,0,1-2.6,1A4.1,4.1,0,0,0,11.75,8a4.73,4.73,0,0,0,.09.93A11.6,11.6,0,0,1,3.39,4.62,4.2,4.2,0,0,0,2.83,6.7a4.09,4.09,0,0,0,1.82,3.4A4,4,0,0,1,2.8,9.6v0a4.11,4.11,0,0,0,3.29,4A4.2,4.2,0,0,1,5,13.81a4,4,0,0,1-.78-.07,4.14,4.14,0,0,0,3.83,2.85A8.22,8.22,0,0,1,3,18.34a6.37,6.37,0,0,1-1-.06,11.48,11.48,0,0,0,6.29,1.84A11.58,11.58,0,0,0,20,8.46c0-.18,0-.36,0-.53A8.31,8.31,0,0,0,22,5.8Z"></path></svg></a>
</p>
</div>
</div>
<div className="row">
<div className="col-md-12">
<h1>Amherst College Campus &amp; Community</h1>
<p>Amherst College Press is proud to participate in the life and community at Amherst College and the greater Pioneer Valley. We are particularly invested in raising awareness about open access and working towards more inclusive scholarly publishing practices. And we are always eager to partner with organizations, community groups, and colleagues at other academic and public libraries. Reach out to us if you would like to learn more about open access humanities book publishing, to request a publishing workshop on your campus, or to simply say hi.</p>
<p>As one of the only university presses based at a liberal arts college, Amherst College Press is committed to developing opportunities for Amherst College undergraduates to become involved in the work of the press. Read more about the Amherst College Press internship program here.</p>
<p>Below you'll find resources created by our interns, including blog posts, book lists, author interviews, and more.</p>
</div>
</div>
<div className="row justify-content-md-center">
<div className="col-md-10">
<CommunityList community={community} />
</div>
</div>
</div>
</Layout>
)
}
export const query = graphql`
{
allMarkdownRemark (
filter: {
frontmatter: { templateKey: { eq: "community" } }
},
sort: {
fields: frontmatter___date,
order: DESC
}
) {
edges {
node {
id
fields{
slug
}
html
frontmatter {
title
summary
date(formatString:"MMMM Do, YYYY")
}
}
}
}
}
`
export default Community
......@@ -13,7 +13,7 @@ const Events = ({data}) => {
<div className="container page-container">
<div className="row text-right">
<div className="col-md-12">
<p className="social scala-sans">Connect with us <a href="http://www.facebook.com/AmCollPress"><svg width="24px" height="24px" viewBox="0 0 24 24" className="social-link fb" aria-hidden="false"><title>Facebook</title><path d="M20.9,2H3.1A1.1,1.1,0,0,0,2,3.1V20.9A1.1,1.1,0,0,0,3.1,22h9.58V14.25h-2.6v-3h2.6V9a3.64,3.64,0,0,1,3.88-4,20.26,20.26,0,0,1,2.33.12v2.7h-1.6c-1.25,0-1.49.59-1.49,1.47v1.92h3l-.39,3H15.8V22h5.1A1.1,1.1,0,0,0,22,20.9V3.1A1.1,1.1,0,0,0,20.9,2Z"></path></svg></a>
<p className="social scala-sans">Connect with us <a href="https://www.instagram.com/amherstcollegepress/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" classname="social-link fb" aria-hidden="false"><title>Instagram</title><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"></path></svg></a>
<a href="http://www.twitter.com/AmCollPress"><svg width="24px" height="24px" viewBox="0 0 24 24" className="social-link tw" aria-hidden="false"><title>Twitter</title><path d="M22,5.8a8.6,8.6,0,0,1-2.36.65,4.07,4.07,0,0,0,1.8-2.27,8.1,8.1,0,0,1-2.6,1A4.1,4.1,0,0,0,11.75,8a4.73,4.73,0,0,0,.09.93A11.6,11.6,0,0,1,3.39,4.62,4.2,4.2,0,0,0,2.83,6.7a4.09,4.09,0,0,0,1.82,3.4A4,4,0,0,1,2.8,9.6v0a4.11,4.11,0,0,0,3.29,4A4.2,4.2,0,0,1,5,13.81a4,4,0,0,1-.78-.07,4.14,4.14,0,0,0,3.83,2.85A8.22,8.22,0,0,1,3,18.34a6.37,6.37,0,0,1-1-.06,11.48,11.48,0,0,0,6.29,1.84A11.58,11.58,0,0,0,20,8.46c0-.18,0-.36,0-.53A8.31,8.31,0,0,0,22,5.8Z"></path></svg></a>
</p>
</div>
......
......@@ -13,7 +13,7 @@ const News = ({data}) => {
<div className="container page-container">
<div className="row text-right">
<div className="col-md-12">
<p className="social scala-sans">Connect with us <a href="https://www.facebook.com/AmCollPress"><svg width="24px" height="24px" viewBox="0 0 24 24" className="social-link fb" aria-hidden="false"><title>Facebook</title><path d="M20.9,2H3.1A1.1,1.1,0,0,0,2,3.1V20.9A1.1,1.1,0,0,0,3.1,22h9.58V14.25h-2.6v-3h2.6V9a3.64,3.64,0,0,1,3.88-4,20.26,20.26,0,0,1,2.33.12v2.7h-1.6c-1.25,0-1.49.59-1.49,1.47v1.92h3l-.39,3H15.8V22h5.1A1.1,1.1,0,0,0,22,20.9V3.1A1.1,1.1,0,0,0,20.9,2Z"></path></svg></a>
<p className="social scala-sans">Connect with us <a href="https://www.instagram.com/amherstcollegepress/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" classname="social-link fb" aria-hidden="false"><title>Instagram</title><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"></path></svg></a>
<a href="http://www.twitter.com/AmCollPress"><svg width="24px" height="24px" viewBox="0 0 24 24" className="social-link tw" aria-hidden="false"><title>Twitter</title><path d="M22,5.8a8.6,8.6,0,0,1-2.36.65,4.07,4.07,0,0,0,1.8-2.27,8.1,8.1,0,0,1-2.6,1A4.1,4.1,0,0,0,11.75,8a4.73,4.73,0,0,0,.09.93A11.6,11.6,0,0,1,3.39,4.62,4.2,4.2,0,0,0,2.83,6.7a4.09,4.09,0,0,0,1.82,3.4A4,4,0,0,1,2.8,9.6v0a4.11,4.11,0,0,0,3.29,4A4.2,4.2,0,0,1,5,13.81a4,4,0,0,1-.78-.07,4.14,4.14,0,0,0,3.83,2.85A8.22,8.22,0,0,1,3,18.34a6.37,6.37,0,0,1-1-.06,11.48,11.48,0,0,0,6.29,1.84A11.58,11.58,0,0,0,20,8.46c0-.18,0-.36,0-.53A8.31,8.31,0,0,0,22,5.8Z"></path></svg></a>
</p>
</div>
......
import React from 'react'
import SEO from "../components/seo"
import Layout from '../components/layout'
import Title from '../components/title'
import {graphql} from 'gatsby'
const Community = ({data}) => {
const title = data.markdownRemark.frontmatter.title
const html = data.markdownRemark.html
return (
<Layout>
<SEO title={title} />
<div className="container page-container">
<Title title={title} />
<div dangerouslySetInnerHTML={{ __html: html }} />
</div>
</Layout>
)
}
export const query = graphql`
query communityPage($id: String!) {
markdownRemark(id: {eq: $id}) {
html
frontmatter{
title
}
}
}
`
export default Community
import React from 'react'
import SEO from "../components/seo"
import Layout from '../components/layout'
import {graphql} from "gatsby"
const Community = ({data}) => {
const { html } = data.markdownRemark
const { title, summary, date } = data.markdownRemark.frontmatter
return (
<Layout>
<SEO title={title} />
<div className="container page-container news-item">
<div className="row justify-content-md-center">
<div className="col-md-10">
<h1 className="mb-3">{title}</h1>
<div className="summary">
<h4 className="mt-4">{date}</h4>
<p className="lead">{summary}</p>
</div>
</div>
</div>
<div className="row justify-content-md-center main">
<div className="col-md-8">
<div dangerouslySetInnerHTML={{ __html: html }} />
</div>
</div>
</div>
</Layout>
)
}
export const query = graphql`
query ($id: String!) {
markdownRemark(id: {eq: $id}) {
html
frontmatter {
title
summary
date(formatString: "MMMM Do, YYYY")
}
}
}
`
export default Community
......@@ -38,6 +38,17 @@ collections:
- { name: orderOnPage, label: "Order on Front Page", widget: number }
- { name: readLink, label: "Read Link" }
- { name: buyLink, label: "Buy Link" }
- name: community
label: Community
folder: src/content/community
create: true
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: news }
- { name: title, label: Title }
- { name: summary, label: Summary }
- { name: date, label: Published, widget: datetime }
- { name: body, label: Body, widget: markdown }
- name: pages
label: Pages
files:
......@@ -126,10 +137,3 @@ collections:
- { name: templateKey, label: "Template Key", widget: hidden, default: internships-page }
- { name: title, label: Internships }
- { name: body, label: Body, widget: markdown }
- file: "src/content/community.md"
name: community
label: Community
fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: community-page }
- { name: title, label: Community }
- { name: body, label: Body, widget: markdown }
Supports Markdown
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