mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-10 12:57:46 +00:00
Added sitemap support, improved tags and description, preload 3rd party sites
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
siteMetadata: {
|
siteMetadata: {
|
||||||
title: `Unicorn Utterances`,
|
title: `Unicorn Utterances`,
|
||||||
description: `Learning programming from magically majestic words`,
|
description: `Learning programming from magically majestic words. A place to learn about all sorts of programming topics from entry-level concepts to advanced abstractions`,
|
||||||
siteUrl: `https://unicorn-utterances.com/`,
|
siteUrl: `https://unicorn-utterances.com/`,
|
||||||
disqusShortname: "unicorn-utterances",
|
disqusShortname: "unicorn-utterances",
|
||||||
repoPath: "crutchcorn/unicorn-utterances",
|
repoPath: "crutchcorn/unicorn-utterances",
|
||||||
@@ -224,6 +224,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
`gatsby-plugin-sitemap`
|
||||||
],
|
],
|
||||||
mapping: {
|
mapping: {
|
||||||
"MarkdownRemark.frontmatter.author": `AuthorsJson`,
|
"MarkdownRemark.frontmatter.author": `AuthorsJson`,
|
||||||
|
|||||||
924
package-lock.json
generated
924
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@
|
|||||||
"gatsby-plugin-react-svg": "^2.1.1",
|
"gatsby-plugin-react-svg": "^2.1.1",
|
||||||
"gatsby-plugin-sass": "^2.1.0",
|
"gatsby-plugin-sass": "^2.1.0",
|
||||||
"gatsby-plugin-sharp": "^2.2.1",
|
"gatsby-plugin-sharp": "^2.2.1",
|
||||||
|
"gatsby-plugin-sitemap": "^2.2.1",
|
||||||
"gatsby-plugin-transition-link": "^1.12.4",
|
"gatsby-plugin-transition-link": "^1.12.4",
|
||||||
"gatsby-remark-autolink-headers": "^2.1.0",
|
"gatsby-remark-autolink-headers": "^2.1.0",
|
||||||
"gatsby-remark-copy-linked-files": "^2.1.0",
|
"gatsby-remark-copy-linked-files": "^2.1.0",
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ export const SearchField = ({ className, onSearch = () => {} }) => {
|
|||||||
<div style={{ height: inputHeight }}/>
|
<div style={{ height: inputHeight }}/>
|
||||||
<PosedInput placeholder={placeholder}
|
<PosedInput placeholder={placeholder}
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
|
aria-label="Search for posts"
|
||||||
onChange={e => {
|
onChange={e => {
|
||||||
const val = e.target.value;
|
const val = e.target.value;
|
||||||
setInputVal(val)
|
setInputVal(val)
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ import BackIcon from "../../assets/icons/back.svg"
|
|||||||
import layoutStyles from "./layout.module.scss"
|
import layoutStyles from "./layout.module.scss"
|
||||||
import "../../global.scss"
|
import "../../global.scss"
|
||||||
|
|
||||||
export const Layout = ({ location, title, children }) => {
|
export const Layout = ({ location, children }) => {
|
||||||
const rootPath = `${__PATH_PREFIX__}/`
|
const rootPath = `${__PATH_PREFIX__}/`
|
||||||
let header
|
|
||||||
|
|
||||||
const isBase = location.pathname === rootPath
|
const isBase = location.pathname === rootPath
|
||||||
const isBlogPost = location.pathname.startsWith(`${rootPath}posts`)
|
const isBlogPost = location.pathname.startsWith(`${rootPath}posts`)
|
||||||
@@ -20,7 +19,6 @@ export const Layout = ({ location, title, children }) => {
|
|||||||
>
|
>
|
||||||
<header className={layoutStyles.header}>
|
<header className={layoutStyles.header}>
|
||||||
{!isBase && <Link className={`${layoutStyles.backBtn} baseBtn`} to={`/`}><BackIcon/></Link>}
|
{!isBase && <Link className={`${layoutStyles.backBtn} baseBtn`} to={`/`}><BackIcon/></Link>}
|
||||||
{header}
|
|
||||||
</header>
|
</header>
|
||||||
<main className={!isBlogPost ? "listViewContent" : "postViewContent"}>{children}</main>
|
<main className={!isBlogPost ? "listViewContent" : "postViewContent"}>{children}</main>
|
||||||
<footer>
|
<footer>
|
||||||
|
|||||||
@@ -105,6 +105,11 @@ function SEO({
|
|||||||
}}
|
}}
|
||||||
title={title}
|
title={title}
|
||||||
titleTemplate={`%s | ${siteData.title}`}
|
titleTemplate={`%s | ${siteData.title}`}
|
||||||
|
link={[
|
||||||
|
{ rel: "icon", href: '/favicon.ico' },
|
||||||
|
{ rel: "preconnect", href: 'https://www.google.com' },
|
||||||
|
{ rel: "preconnect", href: 'https://marketingplatform.google.com' },
|
||||||
|
]}
|
||||||
meta={[
|
meta={[
|
||||||
{
|
{
|
||||||
property: `og:url`,
|
property: `og:url`,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const BlogIndex = (props) => {
|
|||||||
<PicTitleHeader
|
<PicTitleHeader
|
||||||
image={data.file.childImageSharp.fixed}
|
image={data.file.childImageSharp.fixed}
|
||||||
title="Unicorn Utterances"
|
title="Unicorn Utterances"
|
||||||
description="Learning programming from magically majestic words. A place to learn about all sorts of programming topics from entry-level concepts to advanced abstractions"
|
description={data.site.siteMetadata.description}
|
||||||
/>
|
/>
|
||||||
<PostList posts={posts} tags={postTags} />
|
<PostList posts={posts} tags={postTags} />
|
||||||
</div>
|
</div>
|
||||||
@@ -40,6 +40,7 @@ export const pageQuery = graphql`
|
|||||||
site {
|
site {
|
||||||
siteMetadata {
|
siteMetadata {
|
||||||
title
|
title
|
||||||
|
description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
allMarkdownRemark(sort: { fields: [frontmatter___published], order: DESC }) {
|
allMarkdownRemark(sort: { fields: [frontmatter___published], order: DESC }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user