From 92bad9f9bd954646b67be76b6fd9512e09ddc909 Mon Sep 17 00:00:00 2001 From: Joel Coutinho Date: Mon, 5 May 2025 21:24:06 +0530 Subject: [PATCH 1/5] feat: category refresh --- CONTRIBUTING.md | 9 +++++++++ gatsby-node.js | 2 +- src/templates/blog-home.js | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 945b4423..a1c3813e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,6 +61,15 @@ author: "John Doe" - Must have the same name. - This name should be specified in the frontmatter's `cover` property. - **category:** The `category` property should be a string having all the categories for the blog post separated by a comma. For e.g. if we want a post that is visible in the _Featured_ and _Sessions_ tabs, the value would be `featured, sessions`. + - Category has the following filters: + - **Authentication & Identity** + - **Security & Compliance** + - **Developer Guides & Tutorials** + - **Product Updates & Announcements** + - **Company News & Events** + - **Case Studies & Customer Stories** + - **Industry Insights & Trends** + - **author:** Name of the author of this post. #### Content for the post diff --git a/gatsby-node.js b/gatsby-node.js index 01d2ab89..12409094 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -55,7 +55,7 @@ exports.createPages = async ({ actions, graphql }) => { programming: "" } - const allFilters = ["all", "sessions", "featured", "programming"] + const allFilters = ["all", "sessions", "featured", "programming", "test"] allFilters.forEach((filter) => { postsAsHTMLString[filter] = sortedPosts.filter((post) => { if (filter === "all") { diff --git a/src/templates/blog-home.js b/src/templates/blog-home.js index ce9bf366..b24f4c03 100644 --- a/src/templates/blog-home.js +++ b/src/templates/blog-home.js @@ -57,6 +57,13 @@ const BlogHomeTemplate = (props) => { > Programming + From a7ce8dd1069efc79bc6e174e298b91d06c2c575c Mon Sep 17 00:00:00 2001 From: Joel Coutinho Date: Mon, 5 May 2025 21:42:10 +0530 Subject: [PATCH 2/5] updates filter logic --- gatsby-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-node.js b/gatsby-node.js index 12409094..14a9528f 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -55,7 +55,7 @@ exports.createPages = async ({ actions, graphql }) => { programming: "" } - const allFilters = ["all", "sessions", "featured", "programming", "test"] + const allFilters = ["all", "Authentication & Identity", "Security & Compliance", "Developer Guides & Tutorials", "Product Updates & Announcements", "Company News & Events", "Case Studies & Customer Stories", "Industry Insights & Trends"] allFilters.forEach((filter) => { postsAsHTMLString[filter] = sortedPosts.filter((post) => { if (filter === "all") { From b3251c57f39a5608cc2d0c613aed1b86ccbb08fb Mon Sep 17 00:00:00 2001 From: Joel Coutinho Date: Mon, 5 May 2025 21:54:39 +0530 Subject: [PATCH 3/5] more updates --- src/templates/blog-home.js | 51 +++++++++++++++++++++--------- static/blog-seo/sitemapconfig.json | 3 +- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/templates/blog-home.js b/src/templates/blog-home.js index b24f4c03..bf9550dd 100644 --- a/src/templates/blog-home.js +++ b/src/templates/blog-home.js @@ -33,36 +33,57 @@ const BlogHomeTemplate = (props) => { id="tab-1-id" className={`blog-categories__category ${selectedCategory === "all" && "selected"}`} onClick={() => updateCategory("all")} - > + > All + + + diff --git a/static/blog-seo/sitemapconfig.json b/static/blog-seo/sitemapconfig.json index d1069a35..8b865849 100644 --- a/static/blog-seo/sitemapconfig.json +++ b/static/blog-seo/sitemapconfig.json @@ -344,7 +344,8 @@ }, { "location": "https://supertokens.com/blog/cloud-based-authentication" - } + }, + { "location": "https://supertokens.com/blog/2fa-services" }, { From 5004f1cca4c1097c125aaf45b76c15db12b0f72e Mon Sep 17 00:00:00 2001 From: Joel Coutinho Date: Tue, 10 Jun 2025 17:18:27 +0530 Subject: [PATCH 4/5] updates category logic --- src/blog-categories.js | 14 +++++++++++ src/templates/blog-home.js | 49 +++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 27 deletions(-) create mode 100644 src/blog-categories.js diff --git a/src/blog-categories.js b/src/blog-categories.js new file mode 100644 index 00000000..d3ff24bf --- /dev/null +++ b/src/blog-categories.js @@ -0,0 +1,14 @@ + + +const categories = { + ALL: "All", + AUTHENTICATION: "Authentication", + SECURITY: "Security", + TUTORIALS: "Tutorials", + ANNOUNCEMENTS: "Announcements", + NEWS: "News", + CASE_STUDIES: "Case Studies" +} +module.exports = { + categories +} diff --git a/src/templates/blog-home.js b/src/templates/blog-home.js index bf9550dd..7fba80e1 100644 --- a/src/templates/blog-home.js +++ b/src/templates/blog-home.js @@ -1,6 +1,7 @@ import * as React from "react" import "../styles/blog.css" +import { categories } from "../blog-categories"; const BlogHomeTemplate = (props) => { const [selectedCategory, setSelectedCategory] = React.useState("all"); @@ -31,59 +32,53 @@ const BlogHomeTemplate = (props) => {
-
From 3d4b1d94c5ebcfb5656f247b44638c9467b4ad70 Mon Sep 17 00:00:00 2001 From: Joel Coutinho Date: Tue, 10 Jun 2025 21:15:21 +0530 Subject: [PATCH 5/5] more updates --- content/what-is-credential-stuffing/index.md | 2 +- gatsby-node.js | 16 +++++++++------- src/blog-categories.js | 1 - src/templates/blog-home.js | 9 +-------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/content/what-is-credential-stuffing/index.md b/content/what-is-credential-stuffing/index.md index b0c8222b..c371be98 100644 --- a/content/what-is-credential-stuffing/index.md +++ b/content/what-is-credential-stuffing/index.md @@ -3,7 +3,7 @@ title: "What is Credential Stuffing?" description: "Most people are familiar with brute force attacks, where attackers attempt to guess passwords using characters at random paired with common password suggestions, but what is Credential Stuffing? In this we will go over this type of attack and how you can safeguard against it." date: "2024-02-13" cover: "what-is-credential-stuffing.png" -category: "programming" +category: "Authentication" author: "Joel Coutinho" --- diff --git a/gatsby-node.js b/gatsby-node.js index 14a9528f..9b7f2bef 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,5 +1,5 @@ const { createFilePath } = require(`gatsby-source-filesystem`) - +const { categories } = require(`./src/blog-categories`) const webflowPosts = require("./src/blog-details") const getBlogCardString = require("./src/getBlogCardString") @@ -49,16 +49,18 @@ exports.createPages = async ({ actions, graphql }) => { const postsAsHTMLString = { - all: "", - sessions: "", - featured: "", - programming: "" + All: "", + Authentication: "", + Security: "", + Tutorials: "", + Announcements: "", + News: "", } - const allFilters = ["all", "Authentication & Identity", "Security & Compliance", "Developer Guides & Tutorials", "Product Updates & Announcements", "Company News & Events", "Case Studies & Customer Stories", "Industry Insights & Trends"] + const allFilters = [categories.ALL, categories.ANNOUNCEMENTS, categories.AUTHENTICATION, categories.NEWS, categories.SECURITY, categories.SECURITY, categories.TUTORIALS] allFilters.forEach((filter) => { postsAsHTMLString[filter] = sortedPosts.filter((post) => { - if (filter === "all") { + if (filter === categories.ALL) { return true; } diff --git a/src/blog-categories.js b/src/blog-categories.js index d3ff24bf..648f9897 100644 --- a/src/blog-categories.js +++ b/src/blog-categories.js @@ -7,7 +7,6 @@ const categories = { TUTORIALS: "Tutorials", ANNOUNCEMENTS: "Announcements", NEWS: "News", - CASE_STUDIES: "Case Studies" } module.exports = { categories diff --git a/src/templates/blog-home.js b/src/templates/blog-home.js index 7fba80e1..3b17f9eb 100644 --- a/src/templates/blog-home.js +++ b/src/templates/blog-home.js @@ -4,7 +4,7 @@ import "../styles/blog.css" import { categories } from "../blog-categories"; const BlogHomeTemplate = (props) => { - const [selectedCategory, setSelectedCategory] = React.useState("all"); + const [selectedCategory, setSelectedCategory] = React.useState(categories.ALL); const [classToHideList, setClassToHideList] = React.useState("visible"); React.useEffect(() => { @@ -73,13 +73,6 @@ const BlogHomeTemplate = (props) => { > News -