diff --git a/README.md b/README.md index 0628163..ec74c65 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,11 @@ -## 🧐 What's inside? +1. **`.prettierrc`**: This is a configuration file for [Prettier](https://prettier.io/). Prettier is a tool to help keep the formatting of your code consistent. -A quick look at the top-level files and directories you'll see in a Gatsby project. +2. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.com/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser. - . - β”œβ”€β”€ node_modules - β”œβ”€β”€ src - β”œβ”€β”€ .gitignore - β”œβ”€β”€ .prettierrc - β”œβ”€β”€ gatsby-browser.js - β”œβ”€β”€ gatsby-config.js - β”œβ”€β”€ gatsby-node.js - β”œβ”€β”€ gatsby-ssr.js - β”œβ”€β”€ LICENSE - β”œβ”€β”€ package-lock.json - β”œβ”€β”€ package.json - └── README.md +3. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.com/docs/gatsby-config/) for more detail). -1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. +4. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.com/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. -2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. `src` is a convention for β€œsource code”. +5. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.com/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering. -3. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for. - -4. **`.prettierrc`**: This is a configuration file for [Prettier](https://prettier.io/). Prettier is a tool to help keep the formatting of your code consistent. - -5. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.com/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser. - -6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.com/docs/gatsby-config/) for more detail). - -7. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.com/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. - -8. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.com/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering. - -9. **`README.md`**: A text file containing useful reference information about your project. +6. **`README.md`**: A text file containing useful reference information about your project. diff --git a/gatsby-node.js b/gatsby-node.js index b4408a0..d9a9683 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -108,11 +108,13 @@ exports.createPages = async ({ actions, graphql, reporter }) => { exports.createSchemaCustomization = ({ actions: { createTypes } }) => { createTypes(` type Mdx implements Node { - frontmatter: MdxFrontmatter + frontmatter: CommonFrontmatter } - type MdxFrontmatter { - hidden: Boolean + type CommonFrontmatter { + hidden: Boolean, + lang: String, + tags: [String] } `); }; diff --git a/package.json b/package.json index 8331c7c..d8f82b8 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,13 @@ { - "name": "gatsby-starter-hello-world", + "name": "eddie.sh", "private": true, - "description": "A simplified bare-bones starter for Gatsby", + "description": "Personal website", "version": "0.1.0", "license": "0BSD", "scripts": { "build": "gatsby build", "develop": "gatsby develop", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", - "start": "npm run develop", "serve": "gatsby serve", "clean": "gatsby clean", "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" @@ -40,12 +39,5 @@ "gatsby-plugin-eslint": "^2.0.8", "prettier": "2.1.1", "typescript": "^4.0.3" - }, - "repository": { - "type": "git", - "url": "https://github.com/gatsbyjs/gatsby-starter-hello-world" - }, - "bugs": { - "url": "https://github.com/gatsbyjs/gatsby/issues" } } diff --git a/src/components/item.tsx b/src/components/item.tsx index 14bcf27..f048d9a 100644 --- a/src/components/item.tsx +++ b/src/components/item.tsx @@ -2,7 +2,13 @@ import React from 'react'; import style from './item.module.css'; import { Link } from 'gatsby'; -export default (props) => ( +interface ItemProps { + to: string; + title: string; + subtitle?: string; +} + +export default (props: ItemProps): JSX.Element => (

{props.title}

{props.subtitle}

diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 12f1b52..c2f5607 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -12,7 +12,7 @@ const ExactLink = (props) => ( ); -export default function Navbar() { +export default (): JSX.Element => { return ( ); -} +}; diff --git a/src/projects/shlink.mdx b/src/projects/shlink.mdx index e342c4a..0a677ea 100644 --- a/src/projects/shlink.mdx +++ b/src/projects/shlink.mdx @@ -2,6 +2,7 @@ path: "shlink" date: 2020-01-01 title: "Shlink" +lang: "js" --- -Hello world +Hello World diff --git a/src/templates/projects.tsx b/src/templates/projects.tsx index 5834578..f2c0428 100644 --- a/src/templates/projects.tsx +++ b/src/templates/projects.tsx @@ -16,6 +16,7 @@ export default ({ data, pageContext }): JSX.Element => { return ( ); @@ -47,6 +48,7 @@ export const query = graphql` title date(formatString: "YYYY-MM-DD") path + lang } id }