From 2fd08091bcb334afdc49486e46df66a0de6dce49 Mon Sep 17 00:00:00 2001 From: zeineb Date: Tue, 16 Apr 2024 21:54:53 +0100 Subject: [PATCH 1/5] fix commands in package.json --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e68a786a..4eea0b34 100644 --- a/package.json +++ b/package.json @@ -80,10 +80,10 @@ "license": "MIT", "main": "n/a", "scripts": { - "build:pp": "NODE_OPTIONS='--no-experimental-fetch' gatsby build --prefix-paths", - "build": "NODE_OPTIONS='--no-experimental-fetch' gatsby build", + "build:pp": "set NODE_OPTIONS=--no-experimental-fetch && gatsby build --prefix-paths", + "build": "set NODE_OPTIONS=--no-experimental-fetch && gatsby build", "clean": "gatsby clean && rm -r src/generated", - "develop": "NODE_OPTIONS='--no-experimental-fetch' gatsby develop", + "develop": "set NODE_OPTIONS=--no-experimental-fetch && gatsby develop", "format-check:js": "prettier '**/*.{js,jsx}' --check --ignore-path=.eslintignore", "format:js": "prettier '**/*.{js,jsx}' --write --ignore-path=.eslintignore", "generate-images": "node ./scripts/image-generation.js", @@ -98,4 +98,4 @@ "remark-preset-lint-recommended" ] } -} +} \ No newline at end of file From 36b5510e58f22d952873df2b217f6b5c5de38068 Mon Sep 17 00:00:00 2001 From: zeineb Date: Tue, 30 Apr 2024 19:56:40 +0100 Subject: [PATCH 2/5] improve code display in blogs --- gatsby-config.js | 29 ++++++++++++++++++++++++++- src/components/modules/ModuleCard.jsx | 1 + src/templates/Blog.jsx | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index d7349279..6de1e4fe 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -34,7 +34,34 @@ module.exports = { wrapperStyle: `left:0; width: 100%;`, }, }, - "gatsby-remark-prismjs", + { + resolve: "gatsby-remark-prismjs", + options: { + additionalStyles: { + ".gatsby-highlight": { + fontSize: "50px", // Set the desired font size + }, + }, + // Customize Prism options here + classPrefix: "language-", // Prefix for CSS classes added to code blocks + inlineCodeMarker: '`', // Marker for inline code snippets + showLineNumbers: true, // Whether to show line numbers + languageExtensions: [ + { + language: "superscript", + extend: "javascript", + definition: { + superscript_types: /(SuperType)/, + }, + insertBefore: { + function: { + superscript_keywords: /(superif|superelse)/, + }, + }, + }, + ], + }, + }, "gatsby-remark-copy-linked-files", "gatsby-remark-autolink-headers", ], diff --git a/src/components/modules/ModuleCard.jsx b/src/components/modules/ModuleCard.jsx index 09142c43..90a57414 100644 --- a/src/components/modules/ModuleCard.jsx +++ b/src/components/modules/ModuleCard.jsx @@ -10,6 +10,7 @@ import { } from "reactstrap"; import { GatsbyImage, getImage } from "gatsby-plugin-image"; import Tags from "../common/Tags"; +import "prismjs/themes/prism.css"; function ModuleCard({ title, cover, tags, description, url }) { return ( diff --git a/src/templates/Blog.jsx b/src/templates/Blog.jsx index 07d03dd0..c96b88e9 100644 --- a/src/templates/Blog.jsx +++ b/src/templates/Blog.jsx @@ -22,6 +22,12 @@ export default class Blog extends React.Component { const { date } = postNode.fields; return ( +
From 3f4ad30b2b8464d54c70d4a40588ca08bc92e8da Mon Sep 17 00:00:00 2001 From: jdrueckert Date: Wed, 8 May 2024 14:43:38 +0200 Subject: [PATCH 3/5] qa: fix prettier warning --- gatsby-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 6de1e4fe..ce13a175 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -44,8 +44,8 @@ module.exports = { }, // Customize Prism options here classPrefix: "language-", // Prefix for CSS classes added to code blocks - inlineCodeMarker: '`', // Marker for inline code snippets - showLineNumbers: true, // Whether to show line numbers + inlineCodeMarker: '`', // Marker for inline code snippets + showLineNumbers: true, // Whether to show line numbers languageExtensions: [ { language: "superscript", From da2c3c3a34836cf025385b58054023a028b18247 Mon Sep 17 00:00:00 2001 From: jdrueckert Date: Wed, 8 May 2024 14:44:36 +0200 Subject: [PATCH 4/5] qa: fix prettier warning --- src/templates/Blog.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/templates/Blog.jsx b/src/templates/Blog.jsx index c96b88e9..c259f6cc 100644 --- a/src/templates/Blog.jsx +++ b/src/templates/Blog.jsx @@ -23,11 +23,11 @@ export default class Blog extends React.Component { return ( + .gatsby-highlight { + font-size: 15px; + color: red; + } + `}
From 05dabead5989c2348c008a04ceba04a1a0d074ce Mon Sep 17 00:00:00 2001 From: jdrueckert Date: Wed, 8 May 2024 14:48:38 +0200 Subject: [PATCH 5/5] qa: fix remaining prettier warning --- gatsby-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index ce13a175..2c0964e1 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -44,7 +44,7 @@ module.exports = { }, // Customize Prism options here classPrefix: "language-", // Prefix for CSS classes added to code blocks - inlineCodeMarker: '`', // Marker for inline code snippets + inlineCodeMarker: "`", // Marker for inline code snippets showLineNumbers: true, // Whether to show line numbers languageExtensions: [ {