Skip to content

Commit

Permalink
feat: add seo page and change license to MIT
Browse files Browse the repository at this point in the history
  • Loading branch information
SudharakaP committed Jul 10, 2020
1 parent 84a8778 commit 64048d9
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/minimal-portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "1.0.0",
"author": "OpenArchitex <[email protected]>",
"license": "AGPL-3.0-or-later",
"license": "MIT",
"scripts": {
"develop": "gatsby develop",
"build": "gatsby build"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.0.1",
"author": "OpenArchitex <[email protected]>",
"license": "AGPL-3.0-or-later",
"license": "MIT",
"scripts": {
"build": "yarn workspace examples/minimal-portfolio build"
},
Expand Down
5 changes: 5 additions & 0 deletions themes/gatsby-theme-minimal-portfolio/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
module.exports = {
siteMetadata: {
title: "Minimal Portfolio",
description: "Minimal portfolio with About, Projects and Contact sections",
author: "OpenArchitex"
},
plugins: [
'gatsby-plugin-theme-ui',
'gatsby-plugin-mdx'
Expand Down
2 changes: 1 addition & 1 deletion themes/gatsby-theme-minimal-portfolio/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
actions.createPage({
path: basePath,
component: require.resolve("./src/templates/minimal-portfolio.js"),
})
});
}
5 changes: 4 additions & 1 deletion themes/gatsby-theme-minimal-portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "index.js",
"author": "OpenArchitex <[email protected]>",
"license": "AGPL-3.0-or-later",
"license": "MIT",
"scripts": {
"build": "gatsby build",
"clean": "gatsby clean",
Expand All @@ -16,6 +16,7 @@
},
"devDependencies": {
"gatsby": "^2.23.11",
"prettier": "^2.0.5",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
Expand All @@ -25,6 +26,8 @@
"@theme-ui/presets": "^0.3.0",
"gatsby-plugin-mdx": "^1.2.22",
"gatsby-plugin-theme-ui": "^0.3.0",
"prop-types": "^15.7.2",
"react-helmet": "^6.1.0",
"theme-ui": "^0.3.1"
}
}
88 changes: 88 additions & 0 deletions themes/gatsby-theme-minimal-portfolio/src/components/seo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/**
* SEO component that queries for data with
* Gatsby's useStaticQuery React hook
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/

import React from "react"
import PropTypes from "prop-types"
import Helmet from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"

function SEO({ description, lang, meta, title }) {
const { site } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
title
description
author
}
}
}
`
)

const metaDescription = description || site.siteMetadata.description

return (
<Helmet
htmlAttributes={{
lang,
}}
title={title}
titleTemplate={`%s | ${site.siteMetadata.title}`}
meta={[
{
name: `description`,
content: metaDescription,
},
{
property: `og:title`,
content: title,
},
{
property: `og:description`,
content: metaDescription,
},
{
property: `og:type`,
content: `website`,
},
{
name: `twitter:card`,
content: `summary`,
},
{
name: `twitter:creator`,
content: site.siteMetadata.author,
},
{
name: `twitter:title`,
content: title,
},
{
name: `twitter:description`,
content: metaDescription,
},
].concat(meta)}
/>
)
}

SEO.defaultProps = {
lang: `en`,
meta: [],
description: ``,
}

SEO.propTypes = {
description: PropTypes.string,
lang: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
title: PropTypes.string.isRequired,
}

export default SEO
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import Projects from "../components/projects"
import Contact from "../components/contact"
import Footer from "../components/footer";
import { Divider } from "theme-ui";
import SEO from "../components/seo";

const MinimalPortfolio = () => (
<>
<Banner/>
<Layout>
<SEO title="Home" />
<About/>
<Divider />
<Projects/>
Expand Down
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10298,6 +10298,21 @@ react-error-overlay@^3.0.0:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-3.0.0.tgz#c2bc8f4d91f1375b3dad6d75265d51cd5eeaf655"
integrity sha512-XzgvowFrwDo6TWcpJ/WTiarb9UI6lhA4PMzS7n1joK3sHfBBBOQHUc0U4u57D6DWO9vHv6lVSWx2Q/Ymfyv4hw==

react-fast-compare@^3.1.1:
version "3.2.0"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==

react-helmet@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
dependencies:
object-assign "^4.1.1"
prop-types "^15.7.2"
react-fast-compare "^3.1.1"
react-side-effect "^2.1.0"

react-hot-loader@^4.12.21:
version "4.12.21"
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.21.tgz#332e830801fb33024b5a147d6b13417f491eb975"
Expand Down Expand Up @@ -10347,6 +10362,11 @@ react-refresh@^0.7.0:
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.7.2.tgz#f30978d21eb8cac6e2f2fde056a7d04f6844dd50"
integrity sha512-u5l7fhAJXecWUJzVxzMRU2Zvw8m4QmDNHlTrT5uo3KBlYBhmChd7syAakBoay1yIiVhx/8Fi7a6v6kQZfsw81Q==

react-side-effect@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.0.tgz#1ce4a8b4445168c487ed24dab886421f74d380d3"
integrity sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==

react@^16.13.1, react@^16.8.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
Expand Down

0 comments on commit 64048d9

Please sign in to comment.