From a56a19e9ca381133378fad6bc2b8e87a37409133 Mon Sep 17 00:00:00 2001 From: trash07 Date: Sun, 1 Mar 2026 15:01:51 -0500 Subject: [PATCH] feat: add twitter embed support --- gatsby-config.js | 1 + package-lock.json | 24 +++++++++++++++++++ package.json | 1 + .../blog-posts/{mdx.frontmatter__slug}.jsx | 4 ++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 1bfc6b5..48c6616 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -10,6 +10,7 @@ module.exports = { `gatsby-plugin-image`, `gatsby-plugin-sharp`, `gatsby-transformer-sharp`, + `gatsby-plugin-twitter`, { resolve: `gatsby-source-filesystem`, options: { diff --git a/package-lock.json b/package-lock.json index 65fa8e4..e33ecd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "gatsby-plugin-image": "^3.16.0", "gatsby-plugin-mdx": "^5.16.0", "gatsby-plugin-sharp": "^5.16.0", + "gatsby-plugin-twitter": "^5.16.0", "gatsby-remark-prismjs": "^7.16.0", "gatsby-source-filesystem": "^5.16.0", "gatsby-transformer-remark": "^6.16.0", @@ -9434,6 +9435,21 @@ } } }, + "node_modules/gatsby-plugin-twitter": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/gatsby-plugin-twitter/-/gatsby-plugin-twitter-5.16.0.tgz", + "integrity": "sha512-YWKbHqnWaiLFip8ZyFTBRTmvhrBKcVGGlOu/1ELsdJDrKVrFbi7pMkf7PZF/4TbxiSD1pIMEJd7TJDwwLCm6yQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.13" + }, + "engines": { + "node": ">=18.0.0 <26" + }, + "peerDependencies": { + "gatsby": "^5.0.0-next" + } + }, "node_modules/gatsby-plugin-typescript": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/gatsby-plugin-typescript/-/gatsby-plugin-typescript-5.14.0.tgz", @@ -29000,6 +29016,14 @@ } } }, + "gatsby-plugin-twitter": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/gatsby-plugin-twitter/-/gatsby-plugin-twitter-5.16.0.tgz", + "integrity": "sha512-YWKbHqnWaiLFip8ZyFTBRTmvhrBKcVGGlOu/1ELsdJDrKVrFbi7pMkf7PZF/4TbxiSD1pIMEJd7TJDwwLCm6yQ==", + "requires": { + "@babel/runtime": "^7.20.13" + } + }, "gatsby-plugin-typescript": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/gatsby-plugin-typescript/-/gatsby-plugin-typescript-5.14.0.tgz", diff --git a/package.json b/package.json index 5d73ca9..4650567 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "gatsby-plugin-image": "^3.16.0", "gatsby-plugin-mdx": "^5.16.0", "gatsby-plugin-sharp": "^5.16.0", + "gatsby-plugin-twitter": "^5.16.0", "gatsby-remark-prismjs": "^7.16.0", "gatsby-source-filesystem": "^5.16.0", "gatsby-transformer-remark": "^6.16.0", diff --git a/src/pages/blog-posts/{mdx.frontmatter__slug}.jsx b/src/pages/blog-posts/{mdx.frontmatter__slug}.jsx index 1decaef..efbbbb2 100644 --- a/src/pages/blog-posts/{mdx.frontmatter__slug}.jsx +++ b/src/pages/blog-posts/{mdx.frontmatter__slug}.jsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { PostLayout } from '../../components/PostLayout'; import { PostSeo } from '../../components/PostSeo'; -export const Head = ({ pageContext }) => { +export function Head({ pageContext }) { const { frontmatter } = pageContext; return ( <> @@ -10,7 +10,7 @@ export const Head = ({ pageContext }) => { ); -}; +} export default function PostPage({ pageContext, children }) { const { frontmatter } = pageContext;