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/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 01d2ab89..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", "sessions", "featured", "programming"] + 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 new file mode 100644 index 00000000..648f9897 --- /dev/null +++ b/src/blog-categories.js @@ -0,0 +1,13 @@ + + +const categories = { + ALL: "All", + AUTHENTICATION: "Authentication", + SECURITY: "Security", + TUTORIALS: "Tutorials", + ANNOUNCEMENTS: "Announcements", + NEWS: "News", +} +module.exports = { + categories +} diff --git a/src/templates/blog-home.js b/src/templates/blog-home.js index ce9bf366..3b17f9eb 100644 --- a/src/templates/blog-home.js +++ b/src/templates/blog-home.js @@ -1,9 +1,10 @@ import * as React from "react" 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(() => { @@ -31,31 +32,46 @@ const BlogHomeTemplate = (props) => {