From ae55885d3930105198fb220fff220c44a9145c96 Mon Sep 17 00:00:00 2001 From: Riccardo Coppola Date: Fri, 19 Aug 2022 13:40:03 +0200 Subject: [PATCH] Add tags --- .../index.md | 1 + content/blog/on-being-productive/index.md | 1 + content/blog/weekly-review/index.md | 1 + gatsby-config.ts | 4 ++-- graphql-types.ts | 12 ++++++------ src/components/Bio/Bio.module.css | 1 - src/components/Bio/index.tsx | 2 +- src/components/Header/Header.module.css | 2 +- src/components/Post/Post.module.css | 10 +++++++++- src/components/Post/Post.tsx | 19 +++++++++++++++++-- src/components/Seo/Seo.tsx | 9 +++++++-- src/pages/blog.tsx | 1 + src/templates/BlogPost.tsx | 8 ++++++-- src/typings/globals.d.ts | 1 + tsconfig.json | 2 +- 15 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 src/typings/globals.d.ts diff --git a/content/blog/embrace-distributed-teams-and-be-happy/index.md b/content/blog/embrace-distributed-teams-and-be-happy/index.md index 8e5e455..cce9508 100644 --- a/content/blog/embrace-distributed-teams-and-be-happy/index.md +++ b/content/blog/embrace-distributed-teams-and-be-happy/index.md @@ -3,6 +3,7 @@ title: Embrace distributed teams and be happy date: "2020-01-21T11:00:00Z" description: "Although having remote teams usually brings down the cost considerably, it comes with its own set of everyday challenges that can outweigh the benefits if not properly handled." publication_status: published +tags: teamwork --- Remote teams have become the norm, rather than the exception, for many companies requiring software engineering services (and not only). diff --git a/content/blog/on-being-productive/index.md b/content/blog/on-being-productive/index.md index c6a3417..a64aa4d 100644 --- a/content/blog/on-being-productive/index.md +++ b/content/blog/on-being-productive/index.md @@ -3,6 +3,7 @@ title: On being productive date: "2019-07-30T21:16:00Z" description: "Our day is bombarded with inputs, things to be done and to be done on time: the more our lives become dynamic, the less can we rely on routine to remember what we need to do, so we need to develop new habits for being 'productive'." publication_status: published +tags: productivity --- Our day is bombarded with inputs, things to be done and to be done on time: the more our lives become dynamic, the less can we rely on routine to remember what we need to do, so we need to develop new habits for being "productive". diff --git a/content/blog/weekly-review/index.md b/content/blog/weekly-review/index.md index 8225d76..ec444f5 100644 --- a/content/blog/weekly-review/index.md +++ b/content/blog/weekly-review/index.md @@ -3,6 +3,7 @@ title: "Achieving goals: the importance of the Weekly Review" date: "2022-07-27T11:00:00Z" description: "The Weekly Review has the power of getting you to zoom out from the day to day grind of completing tasks, to look at the big picture and make sure that you know why you are doing what you are doing and how that aligns to your goals and values." publication_status: published +tags: productivity --- In the quest of [being productive](/blog/on-being-productive/) and achieve goals, one thing that is easily discovered is that consistency is key: this is actually not a big discovery, as it applies to pretty much every area of life that one may try to improve. diff --git a/gatsby-config.ts b/gatsby-config.ts index 31cae26..74d3f56 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -6,7 +6,7 @@ const siteUrl = process.env.URL || "https://www.riccardocoppola.me"; const config: GatsbyConfig = { siteMetadata: { title: `Riccardo Coppola`, - description: `Notes on web development, life, learning and the world.`, + description: `Notes on programming, life, learning and the world.`, author: { name: `Riccardo Coppola`, summary: `I help companies to create better web applications. @@ -196,7 +196,7 @@ const config: GatsbyConfig = { } `, output: "/rss.xml", - title: "Gatsby Starter Blog RSS Feed", + title: "My notes on programming, life, learning and the world - Riccardo Coppola", }, ], }, diff --git a/graphql-types.ts b/graphql-types.ts index 1564127..1840eab 100644 --- a/graphql-types.ts +++ b/graphql-types.ts @@ -694,8 +694,8 @@ export type Frontmatter = { location?: Maybe; technologies?: Maybe>>; order?: Maybe; - photo?: Maybe; link?: Maybe; + tags?: Maybe; }; @@ -1086,8 +1086,8 @@ export type FrontmatterFilterInput = { location?: InputMaybe; technologies?: InputMaybe; order?: InputMaybe; - photo?: InputMaybe; link?: InputMaybe; + tags?: InputMaybe; }; export type FieldsFilterInput = { @@ -1310,8 +1310,8 @@ export type FileFieldsEnum = | 'childrenMarkdownRemark___frontmatter___location' | 'childrenMarkdownRemark___frontmatter___technologies' | 'childrenMarkdownRemark___frontmatter___order' - | 'childrenMarkdownRemark___frontmatter___photo' | 'childrenMarkdownRemark___frontmatter___link' + | 'childrenMarkdownRemark___frontmatter___tags' | 'childrenMarkdownRemark___fields___slug' | 'childrenMarkdownRemark___excerpt' | 'childrenMarkdownRemark___rawMarkdownBody' @@ -1377,8 +1377,8 @@ export type FileFieldsEnum = | 'childMarkdownRemark___frontmatter___location' | 'childMarkdownRemark___frontmatter___technologies' | 'childMarkdownRemark___frontmatter___order' - | 'childMarkdownRemark___frontmatter___photo' | 'childMarkdownRemark___frontmatter___link' + | 'childMarkdownRemark___frontmatter___tags' | 'childMarkdownRemark___fields___slug' | 'childMarkdownRemark___excerpt' | 'childMarkdownRemark___rawMarkdownBody' @@ -3123,8 +3123,8 @@ export type MarkdownRemarkFieldsEnum = | 'frontmatter___location' | 'frontmatter___technologies' | 'frontmatter___order' - | 'frontmatter___photo' | 'frontmatter___link' + | 'frontmatter___tags' | 'fields___slug' | 'excerpt' | 'rawMarkdownBody' @@ -3502,7 +3502,7 @@ export type ProfileQuery = { file?: { childImageSharp?: { gatsbyImageData: any } export type BlogIndexQueryVariables = Exact<{ [key: string]: never; }>; -export type BlogIndexQuery = { site?: { siteMetadata?: { title?: string | null } | null } | null, allMarkdownRemark: { nodes: Array<{ excerpt?: string | null, fields?: { slug?: string | null } | null, frontmatter?: { date?: any | null, title?: string | null, description?: string | null } | null }> } }; +export type BlogIndexQuery = { site?: { siteMetadata?: { title?: string | null } | null } | null, allMarkdownRemark: { nodes: Array<{ excerpt?: string | null, fields?: { slug?: string | null } | null, frontmatter?: { date?: any | null, title?: string | null, description?: string | null, tags?: string | null } | null }> } }; export type BlogPostBySlugQueryVariables = Exact<{ id: Scalars['String']; diff --git a/src/components/Bio/Bio.module.css b/src/components/Bio/Bio.module.css index 9ea8116..bf5bf4f 100644 --- a/src/components/Bio/Bio.module.css +++ b/src/components/Bio/Bio.module.css @@ -4,5 +4,4 @@ margin-top: 40px; font-size: 18px; font-weight: 300; - font-style: italic; } \ No newline at end of file diff --git a/src/components/Bio/index.tsx b/src/components/Bio/index.tsx index 9510bff..98cfad3 100644 --- a/src/components/Bio/index.tsx +++ b/src/components/Bio/index.tsx @@ -11,7 +11,7 @@ import { container } from "./Bio.module.css"; const Bio = () => { return (
- Notes on web development, life, learning and the world. + My notes on programming, life, learning and the world.
); }; diff --git a/src/components/Header/Header.module.css b/src/components/Header/Header.module.css index 50e4f59..225bfb6 100644 --- a/src/components/Header/Header.module.css +++ b/src/components/Header/Header.module.css @@ -36,6 +36,6 @@ } .author a { - font-size: 25px; + font-size: 24px; } } diff --git a/src/components/Post/Post.module.css b/src/components/Post/Post.module.css index 21ac53f..b7e8ecc 100644 --- a/src/components/Post/Post.module.css +++ b/src/components/Post/Post.module.css @@ -1,7 +1,11 @@ +.container { + margin-bottom: 10px; +} + .postTitle { font-size: 20px; font-weight: 400; - margin-bottom: 20px; + margin-bottom: 0; margin-top: 0; } @@ -14,4 +18,8 @@ line-height: 1.5; margin-bottom: 10px; margin-top: 5px; +} + +small { + font-size: 14px; } \ No newline at end of file diff --git a/src/components/Post/Post.tsx b/src/components/Post/Post.tsx index 87471c4..cf62ce2 100644 --- a/src/components/Post/Post.tsx +++ b/src/components/Post/Post.tsx @@ -1,6 +1,6 @@ import React from "react"; import { Link } from "gatsby"; -import { postTitle, date } from "./Post.module.css"; +import { postTitle, date, container } from "./Post.module.css"; interface Post { excerpt?: string | null; @@ -9,6 +9,7 @@ interface Post { date?: any | null; title?: string | null; description?: string | null; + tags?: string | null; } | null; } @@ -18,10 +19,11 @@ interface PostProps { } export const Post: React.FC = ({ post, title }) => { + const tags = post.frontmatter?.tags?.split(","); return (
  • @@ -32,6 +34,19 @@ export const Post: React.FC = ({ post, title }) => { {title} + {post.frontmatter?.tags && ( +
    + + {tags?.map((tag) => `#${tag.trim()} `)} + +
    + )}
  • diff --git a/src/components/Seo/Seo.tsx b/src/components/Seo/Seo.tsx index 344347d..e81c5eb 100644 --- a/src/components/Seo/Seo.tsx +++ b/src/components/Seo/Seo.tsx @@ -5,7 +5,7 @@ * See: https://www.gatsbyjs.com/docs/use-static-query/ */ -import * as React from "react"; +import React from "react"; import { Helmet } from "react-helmet"; import { useStaticQuery, graphql } from "gatsby"; @@ -14,6 +14,7 @@ interface SeoProps { lang?: string; meta?: any[]; title: string; + type: 'blog' | 'about' } export const Seo: React.FC = ({ @@ -47,12 +48,16 @@ export const Seo: React.FC = ({ lang, }} title={title} - titleTemplate={defaultTitle && `%s | ${defaultTitle}`} + titleTemplate={defaultTitle && `%s - ${defaultTitle}`} meta={[ { name: `description`, content: metaDescription, }, + { + property: `og:locale`, + content: 'en_US', + }, { property: `og:title`, content: title, diff --git a/src/pages/blog.tsx b/src/pages/blog.tsx index dda0ffb..92db8b7 100644 --- a/src/pages/blog.tsx +++ b/src/pages/blog.tsx @@ -64,6 +64,7 @@ export const pageQuery = graphql` date(formatString: "MMMM DD, YYYY") title description + tags } } } diff --git a/src/templates/BlogPost.tsx b/src/templates/BlogPost.tsx index 80e2497..fc47f01 100644 --- a/src/templates/BlogPost.tsx +++ b/src/templates/BlogPost.tsx @@ -42,8 +42,12 @@ const BlogPostTemplate: React.FC> = ({ itemProp="articleBody" />
    -