home page working, etc
This commit is contained in:
@@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
/* Your site config here */
|
/* Your site config here */
|
||||||
|
siteMetadata: {
|
||||||
|
title: `Ben Ramey's Blog`,
|
||||||
|
tagline: `Scripture, programming problems, solutions and stories.`
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
`gatsby-plugin-sass`,
|
`gatsby-plugin-sass`,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export default function Footer() {
|
|||||||
return (
|
return (
|
||||||
<footer className="footer">
|
<footer className="footer">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
|
<hr />
|
||||||
<small>
|
<small>
|
||||||
© <time dateTime={timestamp}>{year}</time>.
|
© <time dateTime={timestamp}>{year}</time>.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function Header() {
|
export default function Header({ title, tagline }) {
|
||||||
return (
|
return (
|
||||||
<header>
|
<header>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="d-flex justify-content-between align-item-center">
|
<div className="d-flex justify-content-between align-item-center">
|
||||||
<a href="/" className="d-flex justify-content-start align-items-center mr-2" title="Home">
|
<a href="/" className="d-flex justify-content-start align-items-center mr-2" title="Home">
|
||||||
<img src="https://en.gravatar.com/userimage/738990/32d8e61848233a67f5e02dcc43be0ff8.jpeg"
|
<img src="https://en.gravatar.com/userimage/738990/32d8e61848233a67f5e02dcc43be0ff8.jpeg"
|
||||||
alt="Gravatar" />
|
alt="Gravatar" />
|
||||||
<span className="ml-2">Ben Ramey's Blog</span>
|
<span className="ml-2">{title}</span>
|
||||||
</a>
|
</a>
|
||||||
<div className="d-none d-sm-flex flex-column justify-content-around ml-2">
|
<div className="d-none d-sm-flex flex-column justify-content-around ml-2">
|
||||||
<small>Scripture, programming problems, solutions and stories.</small>
|
<small>{tagline}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -3,10 +3,10 @@ import Header from './header';
|
|||||||
import Footer from './footer';
|
import Footer from './footer';
|
||||||
import Nav from './nav';
|
import Nav from './nav';
|
||||||
|
|
||||||
export default function Layout({ children }) {
|
export default function Layout({ title, tagline, children }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Header />
|
<Header title={title} tagline={tagline} />
|
||||||
<Nav />
|
<Nav />
|
||||||
<main>
|
<main>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Page from "../templates/page";
|
|||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
return (
|
return (
|
||||||
<Page title="404 : Page not found">
|
<Page pageTitle="404 : Page not found">
|
||||||
<p>
|
<p>
|
||||||
Sorry, we've misplaced that URL or it's pointing
|
Sorry, we've misplaced that URL or it's pointing
|
||||||
to something that doesn't exist.
|
to something that doesn't exist.
|
||||||
|
|||||||
@@ -1,12 +1,67 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { graphql } from "gatsby";
|
||||||
import Page from "../templates/page";
|
import Page from "../templates/page";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home({ data }) {
|
||||||
return (
|
console.log(data);
|
||||||
<Page title="home page">
|
const post = data.allMarkdownRemark.edges[0].node;
|
||||||
<div>
|
const siteMetadata = data.site.siteMetadata;
|
||||||
this is the home page
|
|
||||||
</div>
|
return (
|
||||||
</Page>
|
<Page title={siteMetadata.title} tagline={siteMetadata.tagline}>
|
||||||
);
|
<article className="post">
|
||||||
|
<h1 className="post-title">{post.frontmatter.title}</h1>
|
||||||
|
<div className="post-info d-flex justify-content-start">
|
||||||
|
<time dateTime={post.frontmatter.isoDate} className="post-date">
|
||||||
|
{post.frontmatter.formattedDate}, {post.frontmatter.fromNowDate}
|
||||||
|
</time>
|
||||||
|
<nav className="post-tags">
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
<nav className="post-categories">
|
||||||
|
<span>posted in:</span>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div dangerouslySetInnerHTML={{ __html: post.html }} />
|
||||||
|
</article>
|
||||||
|
<section>
|
||||||
|
<a href={post.fields.slug + "#comments-section"}>
|
||||||
|
See comments
|
||||||
|
</a>
|
||||||
|
</section>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const query = graphql`
|
||||||
|
query {
|
||||||
|
allMarkdownRemark(limit: 1, sort: {fields: frontmatter___date, order: DESC}) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
html
|
||||||
|
frontmatter {
|
||||||
|
title
|
||||||
|
formattedDate: date(formatString: "ddd MMM Do YYYY")
|
||||||
|
isoDate: date(formatString: "")
|
||||||
|
fromNowDate:date(fromNow:true)
|
||||||
|
categories
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
fields {
|
||||||
|
slug
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
site {
|
||||||
|
siteMetadata {
|
||||||
|
title
|
||||||
|
tagline
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sitePage {
|
||||||
|
path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Layout from "../components/layout"
|
import Layout from "../components/layout"
|
||||||
|
|
||||||
export default function Page({ title, children }) {
|
export default function Page({ title, tagline, pageTitle, children }) {
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout title={title} tagline={tagline}>
|
||||||
<article className="page">
|
<article className="page">
|
||||||
<h1 className="page-title">{title}</h1>
|
<h1 className="page-title">{pageTitle}</h1>
|
||||||
{children}
|
{children}
|
||||||
</article>
|
</article>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,46 +4,47 @@ import Layout from "../components/layout";
|
|||||||
import { DiscussionEmbed } from 'disqus-react';
|
import { DiscussionEmbed } from 'disqus-react';
|
||||||
|
|
||||||
export default function Post({ data }) {
|
export default function Post({ data }) {
|
||||||
const post = data.markdownRemark;
|
const post = data.markdownRemark;
|
||||||
|
const siteMetadata = data.site.siteMetadata;
|
||||||
|
|
||||||
var tags = post.frontmatter.tags.map((tag) => {
|
var tags = post.frontmatter.tags.map((tag) => {
|
||||||
return (<a key={tag} href={'/tags/' + tag }>#{tag}</a>);
|
return (<a key={tag} href={'/tags/' + tag}>#{tag}</a>);
|
||||||
});
|
});
|
||||||
var categories = post.frontmatter.categories.map((category) => {
|
var categories = post.frontmatter.categories.map((category) => {
|
||||||
return (<a key={category} href={'/categories/' + category }>#{category}</a>);
|
return (<a key={category} href={'/categories/' + category}>#{category}</a>);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
|
||||||
<Layout>
|
|
||||||
<article className="post">
|
|
||||||
<h1 className="post-title">{post.frontmatter.title}</h1>
|
|
||||||
<div className="post-info d-flex justify-content-start">
|
|
||||||
<time dateTime={post.frontmatter.isoDate} className="post-date">
|
|
||||||
{post.frontmatter.formattedDate}, {post.frontmatter.fromNowDate}
|
|
||||||
</time>
|
|
||||||
<nav className="post-tags">
|
|
||||||
{tags}
|
|
||||||
</nav>
|
|
||||||
<nav className="post-categories">
|
|
||||||
<span>posted in:</span>
|
|
||||||
{categories}
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
<div dangerouslySetInnerHTML={{ __html: post.html }} />
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<DiscussionEmbed
|
return (
|
||||||
shortname='fishybusiness'
|
<Layout title={siteMetadata.title} tagline={siteMetadata.tagline}>
|
||||||
config={
|
<article className="post">
|
||||||
{
|
<h1 className="post-title">{post.frontmatter.title}</h1>
|
||||||
url: "https://" + data.site.host + data.sitePage.path,
|
<div className="post-info d-flex justify-content-start">
|
||||||
identifier: post.slug,
|
<time dateTime={post.frontmatter.isoDate} className="post-date">
|
||||||
title: post.frontmatter.title,
|
{post.frontmatter.formattedDate}, {post.frontmatter.fromNowDate}
|
||||||
language: 'en_US'
|
</time>
|
||||||
}
|
<nav className="post-tags">
|
||||||
}/>
|
{tags}
|
||||||
</Layout>
|
</nav>
|
||||||
)
|
<nav className="post-categories">
|
||||||
|
<span>posted in:</span>
|
||||||
|
{categories}
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div dangerouslySetInnerHTML={{ __html: post.html }} />
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<DiscussionEmbed
|
||||||
|
shortname='fishybusiness'
|
||||||
|
config={
|
||||||
|
{
|
||||||
|
url: "https://" + data.site.host + data.sitePage.path,
|
||||||
|
identifier: post.slug,
|
||||||
|
title: post.frontmatter.title,
|
||||||
|
language: 'en_US'
|
||||||
|
}
|
||||||
|
} />
|
||||||
|
</Layout>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const query = graphql`
|
export const query = graphql`
|
||||||
@@ -63,6 +64,10 @@ export const query = graphql`
|
|||||||
site {
|
site {
|
||||||
host
|
host
|
||||||
port
|
port
|
||||||
|
siteMetadata {
|
||||||
|
title
|
||||||
|
tagline
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sitePage {
|
sitePage {
|
||||||
path
|
path
|
||||||
|
|||||||
Reference in New Issue
Block a user