initial work on an about us page

This commit is contained in:
Corbin Crutchley
2019-08-09 18:00:36 -07:00
parent 3c8faa00b2
commit 1bba616937
6 changed files with 84 additions and 5 deletions

18
content/site/about-us.md Normal file
View File

@@ -0,0 +1,18 @@
---
{
title: "About Us",
description: 'About Unicorn Utterances - who we are, what our goals are, and how we want to help others learn',
}
---
<div class="toparea">Our goal is to provide the best resources possible to learn any computer science related topic</div>
Whether it's from how memory is allocated in assembly or how to do complex CSS animations, to what a For loop is, we want to provide resources that are welcoming, supportive, and informational.
Our content will have a wide range of subject matters, difficulty curves, and (we hope) perspectives. We want to make resources for the seasoned full-time developer just as we would a newcomer hobbyist and everyone between the two.
We know this is a lofty goal, though, and we don't want to do it alone. If you're interested in helping out, open a pull request and help us reach others by providing translations, help the code maintenance on this site, write a post for us, or jump in on discussions and help other readers.
If youd like to get in touch with us, our GitHub is probably the best way to do so.
# Contributors

View File

@@ -26,6 +26,13 @@ module.exports = {
name: `assets`, name: `assets`,
}, },
}, },
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content/site`,
name: `sitecontent`,
},
},
`gatsby-transformer-json`, `gatsby-transformer-json`,
{ {
resolve: `gatsby-source-filesystem`, resolve: `gatsby-source-filesystem`,
@@ -135,6 +142,7 @@ module.exports = {
{ {
allMarkdownRemark( allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___published] }, sort: { order: DESC, fields: [frontmatter___published] },
filter: {fileAbsolutePath: {regex: "/content/blog/"}}
) { ) {
edges { edges {
node { node {
@@ -190,7 +198,7 @@ module.exports = {
{ {
name: "en", name: "en",
// A function for filtering nodes. () => true by default // A function for filtering nodes. () => true by default
filterNodes: node => !!node.frontmatter, filterNodes: node => !!node.frontmatter && !!node.frontmatter.author,
}, },
], ],
// Fields to index. If store === true value will be stored in index file. // Fields to index. If store === true value will be stored in index file.

View File

@@ -10,7 +10,11 @@ exports.createPages = ({ graphql, actions }) => {
return graphql( return graphql(
` `
{ {
allMarkdownRemark(sort: {fields: [frontmatter___published], order: DESC}, limit: 1000) { allMarkdownRemark(
sort: {fields: [frontmatter___published], order: DESC},
filter: {fileAbsolutePath: {regex: "/content/blog/"}},
limit: 1000
) {
edges { edges {
node { node {
fields { fields {
@@ -87,7 +91,6 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions const { createNodeField } = actions
if (node.internal.type === `MarkdownRemark`) { if (node.internal.type === `MarkdownRemark`) {
console.log(node.frontmatter.description)
const value = createFilePath({ node, getNode }) const value = createFilePath({ node, getNode })
createNodeField({ createNodeField({
name: `slug`, name: `slug`,

44
src/pages/about.js Normal file
View File

@@ -0,0 +1,44 @@
import React from "react"
import { graphql, useStaticQuery } from "gatsby"
import { Layout } from "../components/layout/layout"
import { SEO } from "../components/seo"
const AboutUs = (props) => {
const { data: { markdownRemark } } = props
const { markdownRemark: post, site: {siteMetadata: {title: siteTitle}} } = useStaticQuery(graphql`
query AboutUsQuery {
site {
siteMetadata {
title
}
}
markdownRemark(fields: {slug: {eq: "/about-us/"}}) {
id
excerpt(pruneLength: 160)
html
frontmatter {
title
description
}
}
}
`)
console.log(post);
return (
<Layout location={props.location} title={siteTitle}>
<SEO
title={post.frontmatter.title}
description={post.frontmatter.description || post.excerpt}
/>
<div
className="post-body"
dangerouslySetInnerHTML={{ __html: markdownRemark.html }}
/>
</Layout>
)
}
export default AboutUs

View File

@@ -43,7 +43,10 @@ export const pageQuery = graphql`
description description
} }
} }
allMarkdownRemark(sort: { fields: [frontmatter___published], order: DESC }) { allMarkdownRemark(
sort: { fields: [frontmatter___published], order: DESC },
filter: {fileAbsolutePath: {regex: "/content/blog/"}}
) {
edges { edges {
node { node {
...PostInfo ...PostInfo

View File

@@ -64,7 +64,10 @@ export const pageQuery = graphql`
...AuthorInfo ...AuthorInfo
} }
allMarkdownRemark( allMarkdownRemark(
filter: {frontmatter: {author: {id: {eq: $slug}}}}, filter: {
frontmatter: {author: {id: {eq: $slug}}},
fileAbsolutePath: {regex: "/content/blog/"}
},
sort: {order: DESC, fields: frontmatter___published} sort: {order: DESC, fields: frontmatter___published}
) { ) {
totalCount totalCount