Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 18403f1

Browse files
authored
Merge pull request #43 from SwitchbackTech/feature/RedirectToBlog2
Feature: Firebase Redirect
2 parents 0c33f6f + ecba9ef commit 18403f1

7 files changed

Lines changed: 118 additions & 7 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ node_modules
44
.firebaserc
55
.cache/
66
package-lock.json
7-
public
7+
public
8+
*.log

deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gatsby build && firebase deploy

firebase.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@
4848
}
4949
]
5050
}
51+
],
52+
"redirects": [
53+
{
54+
"source": "/",
55+
"destination": "/blog",
56+
"type": 301
57+
}
5158
]
5259
}
53-
}
60+
}

public/index.html

Lines changed: 99 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"componentChunkName":"component---cache-dev-404-page-js","path":"/dev-404-page/","result":{"data":{"allSitePage":{"nodes":[{"path":"/blog/hire-dev-reputation"},{"path":"/blog/hire-dev-prioritization"},{"path":"/blog/hire-dev-communication"},{"path":"/blog/hire-dev-empathy"},{"path":"/blog/hire-dev-best-practices"},{"path":"/blog/page/2"},{"path":"/blog/tag/non-technical"},{"path":"/blog/tag/reputation"},{"path":"/blog/category/hiring"},{"path":"/blog/author/ty-hitzeman"},{"path":"/blog/date/2020-06-25"},{"path":"/blog/date/2020-06-26"},{"path":"/blog/date/2020-06-28"},{"path":"/blog/date/2020-06-27"},{"path":"/blog/date/2020-06-29"},{"path":"/blog/search"},{"path":"/404/"},{"path":"/blog/about/"},{"path":"/blog/contact-us/"},{"path":"/blog/"},{"path":"/"},{"path":"/404.html"}]}},"pageContext":{}}}
1+
{"componentChunkName":"component---cache-dev-404-page-js","path":"/dev-404-page/","result":{"data":{"allSitePage":{"nodes":[{"path":"/blog/hire-dev-prioritization"},{"path":"/blog/hire-dev-reputation"},{"path":"/blog/hire-dev-best-practices"},{"path":"/blog/hire-dev-communication"},{"path":"/blog/hire-dev-empathy"},{"path":"/blog/page/2"},{"path":"/blog/tag/non-technical"},{"path":"/blog/tag/reputation"},{"path":"/blog/category/hiring"},{"path":"/blog/author/ty-hitzeman"},{"path":"/blog/date/2020-06-26"},{"path":"/blog/date/2020-06-25"},{"path":"/blog/date/2020-06-29"},{"path":"/blog/date/2020-06-28"},{"path":"/blog/date/2020-06-27"},{"path":"/blog/search"},{"path":"/404/"},{"path":"/blog/about/"},{"path":"/blog/contact-us/"},{"path":"/blog/"},{"path":"/"},{"path":"/404.html"}]}},"pageContext":{}}}

src/components/menu/mobile-menu/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import NavBar, {NavItem, NavLink} from '../../shared/navbar'
3+
import {inferSlug} from '../../../utils/utilFunctions'
34
import {MobileMenuWrap} from './mobilemenu.stc'
45

56
export const MobileMenu = ({menuData}) => {
@@ -11,7 +12,7 @@ export const MobileMenu = ({menuData}) => {
1112
<NavItem
1213
key={`menu-item-${i}`}
1314
id={`menu-item-${i}`}>
14-
<NavLink path={menu.node.path}>{menu.node.title}</NavLink>
15+
<NavLink path={inferSlug(menu.node.path)}>{menu.node.title}</NavLink>
1516
</NavItem>
1617
)
1718
})}

src/pages/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import React from "react";
2+
import { Link } from "gatsby"
3+
24
import Layout from "../containers/layout/layout";
35
const IndexPage = () => (
46
<Layout>
5-
<h1>Nothin to see here</h1>
6-
<p>TODO: route to /blog</p>
7+
<script>window.location.href="/blog"</script>
8+
<h1>Nothin to see here yet.</h1>
9+
<h1>Checkout the <Link to="/blog">Blog</Link></h1>
710
</Layout>
811
);
912

0 commit comments

Comments
 (0)