-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pages should now be created for the pages collection. list magazines …
…functionality for pages now works. Previous static page collection has been removed.
- Loading branch information
Showing
6 changed files
with
120 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
import { StaticQuery, graphql } from 'gatsby' | ||
|
||
const HeraldArchive = () => ( | ||
<StaticQuery | ||
query={graphql` | ||
query { | ||
allMarkdownRemark( | ||
filter: { fileAbsolutePath: { regex:"/.*/herald/.*/" } }, | ||
sort: { fields: [frontmatter___date], order: DESC }, | ||
limit: 12 | ||
) | ||
{ | ||
nodes { | ||
frontmatter{ | ||
title | ||
} | ||
} | ||
} | ||
} | ||
`} | ||
render={data => ( | ||
<div className="items style1 medium onscroll-fade-in"> | ||
{data.allMarkdownRemark.nodes.map((node, index: number) => ( | ||
<a href={node.frontmatter.pdf} key={index}> | ||
<span className="icon style2 major fa-save"></span> | ||
<p className="major"> | ||
{node.frontmatter.title} | ||
</p> | ||
</a> | ||
))} | ||
</div> | ||
)} | ||
/> | ||
) | ||
|
||
export default HeraldArchive |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react' | ||
import { graphql } from 'gatsby' | ||
import Layout from '../components/Layout' | ||
import SEO from '../components/seo' | ||
import Title from '../components/Title'; | ||
import HeraldArchive from '../components/HeraldArchive'; | ||
|
||
export default ({ data }) => { | ||
const post = data.markdownRemark | ||
|
||
let functionality; | ||
switch (post.frontmatter.functionality) { | ||
case 'list magazines': | ||
functionality = <HeraldArchive /> | ||
break | ||
} | ||
|
||
return ( | ||
<Layout> | ||
<SEO title={post.frontmatter.title} /> | ||
|
||
<section className="wrapper style1 align-center"> | ||
<div className="inner"> | ||
<Title /> | ||
|
||
<h2>{post.frontmatter.title}</h2> | ||
<div dangerouslySetInnerHTML={{ __html: post.html }} /> | ||
{functionality} | ||
</div> | ||
</section> | ||
</Layout> | ||
) | ||
} | ||
|
||
export const query = graphql` | ||
query($slug: String!) { | ||
markdownRemark(fields: { slug: { eq: $slug } }) { | ||
frontmatter { | ||
title | ||
functionality | ||
} | ||
html | ||
} | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters