From e1b448547b2be8c15e4b0c3c7a42dfa571bc8154 Mon Sep 17 00:00:00 2001 From: Tiffany Date: Thu, 19 Dec 2024 10:57:36 -0800 Subject: [PATCH 1/3] added 'premium add-on' snippet to auth & personalization pages and made snippets page a bit clearer --- reusable-snippets.mdx | 49 +++++++++++++------ .../authentication-setup/password.mdx | 11 ++--- .../authentication.mdx | 7 ++- .../personalization.mdx | 6 +-- snippets/special-pricing-snippet.mdx | 4 ++ 5 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 snippets/special-pricing-snippet.mdx diff --git a/reusable-snippets.mdx b/reusable-snippets.mdx index 7aacc900d..0ad0ee9ee 100644 --- a/reusable-snippets.mdx +++ b/reusable-snippets.mdx @@ -5,36 +5,29 @@ icon: 'recycle' --- One of the core principles of software development is DRY (Don't Repeat -Yourself). This is a principle that applies to documentation as +Yourself), which applies to documentation as well. If you find yourself repeating the same content in multiple places, you -should consider creating a custom snippet to keep your content in sync. +should create a custom snippet to keep your content in sync. ## Creating a custom snippet -**Pre-condition**: You must create your snippet file in the `snippets` directory. +**Pre-condition**: You must create your snippet file in the `snippets` directory in order for the import to work. - Any page in the `snippets` directory will be treated as a snippet and will not be rendered into a standalone page. If you want to create a standalone page from the snippet, import the snippet into another file and call it as a component. - + ### Default export -1. Add content to your snippet file that you want to re-use across multiple - locations. Optionally, you can add variables that can be filled in via props - when you import the snippet. +1. Add content to your snippet file that you want to re-use. Optionally, you can add variables that can be filled in via props + when you import the snippet. In this example, our variable is word. ```typescript snippets/my-snippet.mdx -Hello world! This is my content I want to reuse across pages. My keyword of the -day is {word}. +Hello world! This is my content I want to reuse across pages. ``` - - The content that you want to reuse must be inside the `snippets` directory in - order for the import to work. - 2. Import the snippet into your destination file. @@ -50,7 +43,35 @@ import MySnippet from '/snippets/path/to/my-snippet.mdx'; Lorem impsum dolor sit amet. + + +``` + +### Exporting with variables + +1. Optionally, you can add variables that can be filled in via props when you import the snippet. In this example, our variable is word. + +```typescript snippets/my-snippet.mdx +My keyword of the day is {word}. +``` + + +2. Import the snippet into your destination file with the variable. The property will fill in based on your specification. + +```typescript destination-file.mdx +--- +title: My title +description: My Description +--- + +import MySnippet from '/snippets/path/to/my-snippet.mdx'; + +## Header + +Lorem impsum dolor sit amet. + + ``` ### Reusable variables diff --git a/settings/authentication-personalization/authentication-setup/password.mdx b/settings/authentication-personalization/authentication-setup/password.mdx index ec40391e6..7439e881e 100644 --- a/settings/authentication-personalization/authentication-setup/password.mdx +++ b/settings/authentication-personalization/authentication-setup/password.mdx @@ -3,17 +3,16 @@ title: 'Password Handshake' description: 'Use a set of shared passwords to authenticate users' --- - - This is the documentation for the Password **Authentication** Handshake. The Password Handshake is not available for Personalization. - +import MySnippet from '/snippets/special-pricing-snippet.mdx'; + + If you don't have strict security requirements, or you don't want to manage a database of documentation readers, you can use a set of shared passwords to protect your docs. - -Authentication is available only by request. Please contact our sales team for access. After we've enabled access, you can follow the implementation instructions. - +Password Handshake is only available for Authentication Handshake, not for Personalization. + ## Implementation diff --git a/settings/authentication-personalization/authentication.mdx b/settings/authentication-personalization/authentication.mdx index b0fa7f62d..1521f9060 100644 --- a/settings/authentication-personalization/authentication.mdx +++ b/settings/authentication-personalization/authentication.mdx @@ -3,10 +3,9 @@ title: "Authentication" description: "Guarantee privacy of your docs by authenticating users" --- - - Authentication is an enterprise feature. To get access, [contact - sales](mailto:sales@mintlify.com). - +import MySnippet from '/snippets/special-pricing-snippet.mdx'; + + Authentication offers full privacy for all of your documentation content by requiring users to authenticate before viewing any content, such as: diff --git a/settings/authentication-personalization/personalization.mdx b/settings/authentication-personalization/personalization.mdx index 37c4af910..880109fff 100644 --- a/settings/authentication-personalization/personalization.mdx +++ b/settings/authentication-personalization/personalization.mdx @@ -3,9 +3,9 @@ title: 'Personalization' description: 'A list of features unlocked with Personalization' --- - - Personalization is an enterprise feature. To get access, [contact sales](mailto:sales@mintlify.com). - +import MySnippet from '/snippets/special-pricing-snippet.mdx'; + + Personalization refers to a suite of features that allow you to customize your documentation experience based on some information about the user. There are diff --git a/snippets/special-pricing-snippet.mdx b/snippets/special-pricing-snippet.mdx new file mode 100644 index 000000000..6788d7fdf --- /dev/null +++ b/snippets/special-pricing-snippet.mdx @@ -0,0 +1,4 @@ + + This is a premium add-on feature. To get access, please [contact + sales](mailto:sales@mintlify.com). + \ No newline at end of file From c33a185981d697c2ef46a44bd377aa3a316f5868 Mon Sep 17 00:00:00 2001 From: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:52:32 -0800 Subject: [PATCH 2/3] delete snippets --- .../authentication-setup/password.mdx | 22 +++++++----- .../authentication.mdx | 4 --- .../personalization.mdx | 36 ++++++++++--------- snippets/special-pricing-snippet.mdx | 4 --- 4 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 snippets/special-pricing-snippet.mdx diff --git a/settings/authentication-personalization/authentication-setup/password.mdx b/settings/authentication-personalization/authentication-setup/password.mdx index 7439e881e..89fa575d5 100644 --- a/settings/authentication-personalization/authentication-setup/password.mdx +++ b/settings/authentication-personalization/authentication-setup/password.mdx @@ -1,24 +1,30 @@ --- -title: 'Password Handshake' -description: 'Use a set of shared passwords to authenticate users' +title: "Password Handshake" +description: "Use a set of shared passwords to authenticate users" --- -import MySnippet from '/snippets/special-pricing-snippet.mdx'; - - + + This is the documentation for the Password **Authentication** Handshake. The + Password Handshake is not available for Personalization. + If you don't have strict security requirements, or you don't want to manage a database of documentation readers, you can use a set of shared passwords to protect your docs. -Password Handshake is only available for Authentication Handshake, not for Personalization. - + + Authentication is available only by request. Please{" "} + contact our sales team for access. + After we've enabled access, you can follow the implementation instructions. + ## Implementation - Go to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication) and create a password. + Go to your [Mintlify dashboard + settings](https://dashboard.mintlify.com/products/authentication) and create + a password. Securely share the password with your documentation readers. That's it! diff --git a/settings/authentication-personalization/authentication.mdx b/settings/authentication-personalization/authentication.mdx index 1521f9060..81c5b8a7e 100644 --- a/settings/authentication-personalization/authentication.mdx +++ b/settings/authentication-personalization/authentication.mdx @@ -3,10 +3,6 @@ title: "Authentication" description: "Guarantee privacy of your docs by authenticating users" --- -import MySnippet from '/snippets/special-pricing-snippet.mdx'; - - - Authentication offers full privacy for all of your documentation content by requiring users to authenticate before viewing any content, such as: diff --git a/settings/authentication-personalization/personalization.mdx b/settings/authentication-personalization/personalization.mdx index 493081b26..05baef8e8 100644 --- a/settings/authentication-personalization/personalization.mdx +++ b/settings/authentication-personalization/personalization.mdx @@ -1,12 +1,8 @@ --- -title: 'Personalization' -description: 'A list of features unlocked with Personalization' +title: "Personalization" +description: "A list of features unlocked with Personalization" --- -import MySnippet from '/snippets/special-pricing-snippet.mdx'; - - - Personalization refers to a suite of features that allow you to customize your documentation experience based on some information about the user. There are three major features of Personalization: @@ -35,8 +31,8 @@ Personalization is an enterprise feature. { user.org === undefined ? <>To access this feature, first create an account at the Mintlify dashboard. : user.org.plan !== 'enterprise' - ? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, contact our sales team. - : <>To request this feature for your enterprise org, contact our team. +? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, contact our sales team. +: <>To request this feature for your enterprise org, contact our team. } ```jsx @@ -50,7 +46,10 @@ Personalization is an enterprise feature. { ``` - The information in `user` is only available after a user has logged in. For logged out users, the value of `user` will be `{}`. To prevent the page from crashing for logged-out users, always use optional chaining on your `user` fields, e.g. `{user.org?.plan}` + The information in `user` is only available after a user has logged in. For + logged out users, the value of `user` will be `{}`. To prevent the page from + crashing for logged-out users, always use optional chaining on your `user` + fields, e.g. `{user.org?.plan}` ### Prefilling API Keys @@ -65,18 +64,21 @@ If the user is not in any of the groups listed in the page metadata, the page wi ```md --- -title: 'Managing Your Users' -description: 'Adding and removing users from your organization' -groups: ['admin'] +title: "Managing Your Users" +description: "Adding and removing users from your organization" +groups: ["admin"] --- ``` Here's a table that displays whether a page is shown for different combinations of `groups` in User and page metadata: | | `groups` not in User | `groups: []` in User | `groups: ['admin']` in User | -| :------------------------------ | :----------------------: | :----------------------: | :-----------------------------: | -| `groups` not in metadata | ✅ | ✅ | ✅ | -| `groups: []` in metadata | ❌ | ❌ | ❌ | -| `groups: ['admin']` in metadata | ❌ | ❌ | ✅ | +| :------------------------------ | :------------------: | :------------------: | :-------------------------: | +| `groups` not in metadata | ✅ | ✅ | ✅ | +| `groups: []` in metadata | ❌ | ❌ | ❌ | +| `groups: ['admin']` in metadata | ❌ | ❌ | ✅ | -Note that an empty array in the page metadata is interpreted as "No groups should see this page." \ No newline at end of file + + Note that an empty array in the page metadata is interpreted as "No groups + should see this page." + diff --git a/snippets/special-pricing-snippet.mdx b/snippets/special-pricing-snippet.mdx deleted file mode 100644 index 6788d7fdf..000000000 --- a/snippets/special-pricing-snippet.mdx +++ /dev/null @@ -1,4 +0,0 @@ - - This is a premium add-on feature. To get access, please [contact - sales](mailto:sales@mintlify.com). - \ No newline at end of file From 5640c1b9fe72b2ba08d49813dede0c51ec4ecbb0 Mon Sep 17 00:00:00 2001 From: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:55:12 -0800 Subject: [PATCH 3/3] remove Mintlify --- .../authentication-setup/password.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/authentication-personalization/authentication-setup/password.mdx b/settings/authentication-personalization/authentication-setup/password.mdx index 89fa575d5..c68a0f886 100644 --- a/settings/authentication-personalization/authentication-setup/password.mdx +++ b/settings/authentication-personalization/authentication-setup/password.mdx @@ -22,7 +22,7 @@ protect your docs. - Go to your [Mintlify dashboard + Go to your [dashboard settings](https://dashboard.mintlify.com/products/authentication) and create a password.