mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 04:22:01 +00:00
initial work on an about us page
This commit is contained in:
18
content/site/about-us.md
Normal file
18
content/site/about-us.md
Normal 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 you’d like to get in touch with us, our GitHub is probably the best way to do so.
|
||||||
|
|
||||||
|
# Contributors
|
||||||
@@ -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.
|
||||||
|
|||||||
@@ -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
44
src/pages/about.js
Normal 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
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user