From cbb202764c39c1ba66857431d5291bc54f20a426 Mon Sep 17 00:00:00 2001 From: Nemi Shah Date: Sat, 14 Dec 2024 13:58:54 +0530 Subject: [PATCH] Add toc plugin --- content/django-user-authentication/index.md | 5 +++++ gatsby-config.js | 11 +++++++++++ package-lock.json | 19 +++++++++++++++++++ package.json | 1 + 4 files changed, 36 insertions(+) diff --git a/content/django-user-authentication/index.md b/content/django-user-authentication/index.md index 0e547ccc..c5da7edb 100644 --- a/content/django-user-authentication/index.md +++ b/content/django-user-authentication/index.md @@ -7,6 +7,11 @@ category: "programming, featured" author: "Nemi Shah" --- +```toc +tight: true +toHeading: 3 +``` + Authentication has become a common concept in almost every application today, with most web applications requiring users to log in to gain access to features and personalisation. Ensuring that user data is protected and stored securely has become even more important to make sure nobody can gain unauthorised access to your application. All of this makes it crucial to user or build a reliable user authentication system that ensures data security while providing you with the flexibility to build your application your way. Django provides a built-in solution for user auth which provides features such as user accounts, permissions and cookie-based session management out of the box while still allowing you to extend and customise them to suit your needs. In this article we will visit how you can use Django's built-in auth mechanisms and compare it with a possible alternative. diff --git a/gatsby-config.js b/gatsby-config.js index 807b8eab..8181abf8 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -67,6 +67,17 @@ module.exports = { rel: "nofollow" } }, + { + resolve: `gatsby-remark-table-of-contents`, + options: { + exclude: "Table of Contents", + tight: false, + ordered: false, + fromHeading: 1, + toHeading: 6, + className: "table-of-contents" + }, + }, `gatsby-remark-autolink-headers`, `gatsby-remark-code-titles`, `gatsby-remark-prismjs`, diff --git a/package-lock.json b/package-lock.json index 3ec4e37c..1ab34a72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "gatsby-remark-prismjs": "^6.7.0", "gatsby-remark-responsive-iframe": "^5.7.0", "gatsby-remark-smartypants": "^5.7.0", + "gatsby-remark-table-of-contents": "^2.0.0", "gatsby-source-filesystem": "^4.7.0", "gatsby-transformer-remark": "^5.7.0", "gatsby-transformer-sharp": "^4.7.0", @@ -9228,6 +9229,15 @@ "gatsby": "^4.0.0-next" } }, + "node_modules/gatsby-remark-table-of-contents": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/gatsby-remark-table-of-contents/-/gatsby-remark-table-of-contents-2.0.0.tgz", + "integrity": "sha512-Hl/zfvwX0FWMjaurzOTLpHNQ4rOd4AXnNrRsqJLwZPecZBc42UDX/JFL4hYS/NfrPd/svtwipkBXGo51CaKFXw==", + "dependencies": { + "js-yaml": "^3.14.1", + "mdast-util-toc": "^5.1.0" + } + }, "node_modules/gatsby-sharp": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/gatsby-sharp/-/gatsby-sharp-0.1.0.tgz", @@ -26684,6 +26694,15 @@ "unist-util-visit": "^2.0.3" } }, + "gatsby-remark-table-of-contents": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/gatsby-remark-table-of-contents/-/gatsby-remark-table-of-contents-2.0.0.tgz", + "integrity": "sha512-Hl/zfvwX0FWMjaurzOTLpHNQ4rOd4AXnNrRsqJLwZPecZBc42UDX/JFL4hYS/NfrPd/svtwipkBXGo51CaKFXw==", + "requires": { + "js-yaml": "^3.14.1", + "mdast-util-toc": "^5.1.0" + } + }, "gatsby-sharp": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/gatsby-sharp/-/gatsby-sharp-0.1.0.tgz", diff --git a/package.json b/package.json index 6e488241..e44d571f 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "gatsby-remark-prismjs": "^6.7.0", "gatsby-remark-responsive-iframe": "^5.7.0", "gatsby-remark-smartypants": "^5.7.0", + "gatsby-remark-table-of-contents": "^2.0.0", "gatsby-source-filesystem": "^4.7.0", "gatsby-transformer-remark": "^5.7.0", "gatsby-transformer-sharp": "^4.7.0",