feat(nx-dev): allow custom media images (#20561)

This commit is contained in:
Isaac Mann 2023-12-07 10:37:01 -05:00 committed by GitHub
parent be821aa15e
commit cf976ce596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 864 additions and 14 deletions

View File

@ -68,6 +68,12 @@ description: This is a custom description
---
```
### Social Media Images
You can specify a custom social media image for a page by specifying `mediaImage` in the `map.json` entry for that page. `mediaImage` is a path relative to `/docs`.
Note that you won't see the social media image in the preview generated for your PR, because it loads from the live `nx.dev` site. You can make sure the image is correct by looking at `[preview-url]/images/open-graph/[page-url].[image-extension]`.
### Custom markdown syntax
The documentation website [nx.dev](https://nx.dev) is using custom Markdown syntax to enable the authors to add functionality to its content.

View File

@ -3,12 +3,14 @@
"id": "intro",
"name": "Intro",
"description": "Learn about basic Nx Cloud knowledge.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "ci-with-nx",
"name": "CI with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/intro/ci-with-nx",
"itemList": [],
"isExternal": false,
@ -19,12 +21,14 @@
"id": "tutorials",
"name": "Tutorials",
"description": "Tutorials setting up CI with Nx",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "circle",
"name": "Circle CI with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/tutorial/circle",
"itemList": [],
"isExternal": false,
@ -35,6 +39,7 @@
"id": "github-actions",
"name": "GitHub Actions with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/tutorial/github-actions",
"itemList": [],
"isExternal": false,
@ -55,6 +60,7 @@
"id": "ci-with-nx",
"name": "CI with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/intro/ci-with-nx",
"itemList": [],
"isExternal": false,
@ -65,12 +71,14 @@
"id": "tutorials",
"name": "Tutorials",
"description": "Tutorials setting up CI with Nx",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "circle",
"name": "Circle CI with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/tutorial/circle",
"itemList": [],
"isExternal": false,
@ -81,6 +89,7 @@
"id": "github-actions",
"name": "GitHub Actions with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/tutorial/github-actions",
"itemList": [],
"isExternal": false,
@ -96,6 +105,7 @@
"id": "circle",
"name": "Circle CI with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/tutorial/circle",
"itemList": [],
"isExternal": false,
@ -106,6 +116,7 @@
"id": "github-actions",
"name": "GitHub Actions with Nx",
"description": "",
"mediaImage": "",
"file": "nx-cloud/tutorial/github-actions",
"itemList": [],
"isExternal": false,
@ -116,12 +127,14 @@
"id": "features",
"name": "Features",
"description": "Features of Nx and Nx Cloud that improve CI",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "remote-cache",
"name": "Use Remote Caching",
"description": "Learn how to enable remote caching s.t. you don't just benefit locally from it but also in CI.",
"mediaImage": "",
"file": "shared/core-features/remote-cache",
"itemList": [],
"isExternal": false,
@ -132,6 +145,7 @@
"id": "affected",
"name": "Run Only Tasks Affected by a PR",
"description": "",
"mediaImage": "",
"file": "shared/using-nx/affected",
"itemList": [],
"isExternal": false,
@ -142,6 +156,7 @@
"id": "distribute-task-execution",
"name": "Distribute Task Execution",
"description": "Learn how to efficiently distribute tasks across machines to take full advantage of parallelization. Nx Cloud has a built-in DTE mechanism which makes this a trivial task.",
"mediaImage": "",
"file": "shared/core-features/distribute-task-execution",
"itemList": [],
"isExternal": false,
@ -152,6 +167,7 @@
"id": "on-premise",
"name": "Set up Nx Cloud On-Premise",
"description": "Set up Nx Cloud on machines that you control",
"mediaImage": "",
"file": "nx-cloud/private/nx-enterprise-on-prem",
"itemList": [],
"isExternal": false,
@ -162,6 +178,7 @@
"id": "nx-agents",
"name": "Nx Agents",
"description": "",
"mediaImage": "",
"file": "nx-cloud/intro/nx-agents",
"itemList": [],
"isExternal": false,
@ -177,6 +194,7 @@
"id": "remote-cache",
"name": "Use Remote Caching",
"description": "Learn how to enable remote caching s.t. you don't just benefit locally from it but also in CI.",
"mediaImage": "",
"file": "shared/core-features/remote-cache",
"itemList": [],
"isExternal": false,
@ -187,6 +205,7 @@
"id": "affected",
"name": "Run Only Tasks Affected by a PR",
"description": "",
"mediaImage": "",
"file": "shared/using-nx/affected",
"itemList": [],
"isExternal": false,
@ -197,6 +216,7 @@
"id": "distribute-task-execution",
"name": "Distribute Task Execution",
"description": "Learn how to efficiently distribute tasks across machines to take full advantage of parallelization. Nx Cloud has a built-in DTE mechanism which makes this a trivial task.",
"mediaImage": "",
"file": "shared/core-features/distribute-task-execution",
"itemList": [],
"isExternal": false,
@ -207,6 +227,7 @@
"id": "on-premise",
"name": "Set up Nx Cloud On-Premise",
"description": "Set up Nx Cloud on machines that you control",
"mediaImage": "",
"file": "nx-cloud/private/nx-enterprise-on-prem",
"itemList": [],
"isExternal": false,
@ -217,6 +238,7 @@
"id": "nx-agents",
"name": "Nx Agents",
"description": "",
"mediaImage": "",
"file": "nx-cloud/intro/nx-agents",
"itemList": [],
"isExternal": false,
@ -227,6 +249,7 @@
"id": "concepts",
"name": "Concepts",
"description": "Learn how to manage Nx Cloud subscriptions and other options.",
"mediaImage": "",
"file": "",
"itemList": [
{
@ -243,6 +266,7 @@
"id": "reduce-waste",
"name": "Reduce Wasted Time in CI",
"description": "",
"mediaImage": "",
"file": "nx-cloud/concepts/reduce-waste",
"itemList": [],
"isExternal": false,
@ -253,6 +277,7 @@
"id": "parallelization-distribution",
"name": "Parallelization and Distribution",
"description": "",
"mediaImage": "",
"file": "nx-cloud/concepts/parallelization-distribution",
"itemList": [],
"isExternal": false,
@ -263,6 +288,7 @@
"id": "cache-security",
"name": "Cache Security",
"description": "",
"mediaImage": "",
"file": "nx-cloud/concepts/cache-security",
"itemList": [],
"isExternal": false,
@ -288,6 +314,7 @@
"id": "reduce-waste",
"name": "Reduce Wasted Time in CI",
"description": "",
"mediaImage": "",
"file": "nx-cloud/concepts/reduce-waste",
"itemList": [],
"isExternal": false,
@ -298,6 +325,7 @@
"id": "parallelization-distribution",
"name": "Parallelization and Distribution",
"description": "",
"mediaImage": "",
"file": "nx-cloud/concepts/parallelization-distribution",
"itemList": [],
"isExternal": false,
@ -308,6 +336,7 @@
"id": "cache-security",
"name": "Cache Security",
"description": "",
"mediaImage": "",
"file": "nx-cloud/concepts/cache-security",
"itemList": [],
"isExternal": false,
@ -318,18 +347,21 @@
"id": "recipes",
"name": "Recipes",
"description": "Learn how to set up Nx Cloud for your workspace.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "set-up",
"name": "Set Up CI",
"description": "Learn how to set up Nx Cloud for your workspace.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "monorepo-ci-azure",
"name": "Setting up Azure Pipelines",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-azure",
"itemList": [],
"isExternal": false,
@ -340,6 +372,7 @@
"id": "monorepo-ci-circle-ci",
"name": "Setting up CircleCI",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-circle-ci",
"itemList": [],
"isExternal": false,
@ -350,6 +383,7 @@
"id": "monorepo-ci-github-actions",
"name": "Setting up GitHub Actions",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-github-actions",
"itemList": [],
"isExternal": false,
@ -360,6 +394,7 @@
"id": "monorepo-ci-jenkins",
"name": "Setting up Jenkins",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-jenkins",
"itemList": [],
"isExternal": false,
@ -370,6 +405,7 @@
"id": "monorepo-ci-gitlab",
"name": "Setting up GitLab",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-gitlab",
"itemList": [],
"isExternal": false,
@ -380,6 +416,7 @@
"id": "monorepo-ci-bitbucket-pipelines",
"name": "Setting up Bitbucket",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-bitbucket-pipelines",
"itemList": [],
"isExternal": false,
@ -395,12 +432,14 @@
"id": "security",
"name": "Security",
"description": "Manage access to Nx Cloud",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "google-auth",
"name": "Authenticate with Google Identity",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/google-auth",
"itemList": [],
"isExternal": false,
@ -411,6 +450,7 @@
"id": "access-tokens",
"name": "Access Tokens",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/access-tokens",
"itemList": [],
"isExternal": false,
@ -421,6 +461,7 @@
"id": "encryption",
"name": "Enable End to End Encryption",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/encryption",
"itemList": [],
"isExternal": false,
@ -436,12 +477,14 @@
"id": "source-control-integration",
"name": "Source Control Integration",
"description": "Show Nx Cloud results directly in your pull request",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "github",
"name": "Enable GitHub PR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/github",
"itemList": [],
"isExternal": false,
@ -452,6 +495,7 @@
"id": "bitbucket-cloud",
"name": "Enable Bitbucket Cloud PR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/bitbucket-cloud",
"itemList": [],
"isExternal": false,
@ -462,6 +506,7 @@
"id": "gitlab",
"name": "Enable GitLab MR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/gitlab",
"itemList": [],
"isExternal": false,
@ -477,12 +522,14 @@
"id": "on-premise",
"name": "On-Premise",
"description": "Manage an on-premise installation of Nx Cloud",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "auth-single-admin",
"name": "Authenticate with a Single Admin",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-single-admin",
"itemList": [],
"isExternal": false,
@ -493,6 +540,7 @@
"id": "auth-github",
"name": "Authenticate with GitHub",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-github",
"itemList": [],
"isExternal": false,
@ -503,6 +551,7 @@
"id": "ami-setup",
"name": "On-Prem VM Setup",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/ami-setup",
"itemList": [],
"isExternal": false,
@ -513,6 +562,7 @@
"id": "auth-gitlab",
"name": "Authenticate with GitLab",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-gitlab",
"itemList": [],
"isExternal": false,
@ -523,6 +573,7 @@
"id": "auth-bitbucket",
"name": "Authenticate with BitBucket",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-bitbucket",
"itemList": [],
"isExternal": false,
@ -533,6 +584,7 @@
"id": "auth-saml",
"name": "Authenticate via SAML",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-saml",
"itemList": [],
"isExternal": false,
@ -543,6 +595,7 @@
"id": "auth-saml-managed",
"name": "Authenticate via SAML on Managed Version",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-saml-managed",
"itemList": [],
"isExternal": false,
@ -553,6 +606,7 @@
"id": "advanced-config",
"name": "Advanced Configuration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/advanced-config",
"itemList": [],
"isExternal": false,
@ -568,12 +622,14 @@
"id": "other",
"name": "Other",
"description": "Learn how to set up Nx Cloud for your workspace.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "record-commands",
"name": "Record Non-Nx Commands",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/record-commands",
"itemList": [],
"isExternal": false,
@ -584,6 +640,7 @@
"id": "ci-deployment",
"name": "Prepare applications for deployment via CI",
"description": "",
"mediaImage": "",
"file": "shared/recipes/ci-deployment",
"itemList": [],
"isExternal": false,
@ -604,12 +661,14 @@
"id": "set-up",
"name": "Set Up CI",
"description": "Learn how to set up Nx Cloud for your workspace.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "monorepo-ci-azure",
"name": "Setting up Azure Pipelines",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-azure",
"itemList": [],
"isExternal": false,
@ -620,6 +679,7 @@
"id": "monorepo-ci-circle-ci",
"name": "Setting up CircleCI",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-circle-ci",
"itemList": [],
"isExternal": false,
@ -630,6 +690,7 @@
"id": "monorepo-ci-github-actions",
"name": "Setting up GitHub Actions",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-github-actions",
"itemList": [],
"isExternal": false,
@ -640,6 +701,7 @@
"id": "monorepo-ci-jenkins",
"name": "Setting up Jenkins",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-jenkins",
"itemList": [],
"isExternal": false,
@ -650,6 +712,7 @@
"id": "monorepo-ci-gitlab",
"name": "Setting up GitLab",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-gitlab",
"itemList": [],
"isExternal": false,
@ -660,6 +723,7 @@
"id": "monorepo-ci-bitbucket-pipelines",
"name": "Setting up Bitbucket",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-bitbucket-pipelines",
"itemList": [],
"isExternal": false,
@ -675,6 +739,7 @@
"id": "monorepo-ci-azure",
"name": "Setting up Azure Pipelines",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-azure",
"itemList": [],
"isExternal": false,
@ -685,6 +750,7 @@
"id": "monorepo-ci-circle-ci",
"name": "Setting up CircleCI",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-circle-ci",
"itemList": [],
"isExternal": false,
@ -695,6 +761,7 @@
"id": "monorepo-ci-github-actions",
"name": "Setting up GitHub Actions",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-github-actions",
"itemList": [],
"isExternal": false,
@ -705,6 +772,7 @@
"id": "monorepo-ci-jenkins",
"name": "Setting up Jenkins",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-jenkins",
"itemList": [],
"isExternal": false,
@ -715,6 +783,7 @@
"id": "monorepo-ci-gitlab",
"name": "Setting up GitLab",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-gitlab",
"itemList": [],
"isExternal": false,
@ -725,6 +794,7 @@
"id": "monorepo-ci-bitbucket-pipelines",
"name": "Setting up Bitbucket",
"description": "",
"mediaImage": "",
"file": "shared/monorepo-ci-bitbucket-pipelines",
"itemList": [],
"isExternal": false,
@ -735,12 +805,14 @@
"id": "security",
"name": "Security",
"description": "Manage access to Nx Cloud",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "google-auth",
"name": "Authenticate with Google Identity",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/google-auth",
"itemList": [],
"isExternal": false,
@ -751,6 +823,7 @@
"id": "access-tokens",
"name": "Access Tokens",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/access-tokens",
"itemList": [],
"isExternal": false,
@ -761,6 +834,7 @@
"id": "encryption",
"name": "Enable End to End Encryption",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/encryption",
"itemList": [],
"isExternal": false,
@ -776,6 +850,7 @@
"id": "google-auth",
"name": "Authenticate with Google Identity",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/google-auth",
"itemList": [],
"isExternal": false,
@ -786,6 +861,7 @@
"id": "access-tokens",
"name": "Access Tokens",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/access-tokens",
"itemList": [],
"isExternal": false,
@ -796,6 +872,7 @@
"id": "encryption",
"name": "Enable End to End Encryption",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/encryption",
"itemList": [],
"isExternal": false,
@ -806,12 +883,14 @@
"id": "source-control-integration",
"name": "Source Control Integration",
"description": "Show Nx Cloud results directly in your pull request",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "github",
"name": "Enable GitHub PR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/github",
"itemList": [],
"isExternal": false,
@ -822,6 +901,7 @@
"id": "bitbucket-cloud",
"name": "Enable Bitbucket Cloud PR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/bitbucket-cloud",
"itemList": [],
"isExternal": false,
@ -832,6 +912,7 @@
"id": "gitlab",
"name": "Enable GitLab MR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/gitlab",
"itemList": [],
"isExternal": false,
@ -847,6 +928,7 @@
"id": "github",
"name": "Enable GitHub PR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/github",
"itemList": [],
"isExternal": false,
@ -857,6 +939,7 @@
"id": "bitbucket-cloud",
"name": "Enable Bitbucket Cloud PR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/bitbucket-cloud",
"itemList": [],
"isExternal": false,
@ -867,6 +950,7 @@
"id": "gitlab",
"name": "Enable GitLab MR Integration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/gitlab",
"itemList": [],
"isExternal": false,
@ -877,12 +961,14 @@
"id": "on-premise",
"name": "On-Premise",
"description": "Manage an on-premise installation of Nx Cloud",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "auth-single-admin",
"name": "Authenticate with a Single Admin",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-single-admin",
"itemList": [],
"isExternal": false,
@ -893,6 +979,7 @@
"id": "auth-github",
"name": "Authenticate with GitHub",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-github",
"itemList": [],
"isExternal": false,
@ -903,6 +990,7 @@
"id": "ami-setup",
"name": "On-Prem VM Setup",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/ami-setup",
"itemList": [],
"isExternal": false,
@ -913,6 +1001,7 @@
"id": "auth-gitlab",
"name": "Authenticate with GitLab",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-gitlab",
"itemList": [],
"isExternal": false,
@ -923,6 +1012,7 @@
"id": "auth-bitbucket",
"name": "Authenticate with BitBucket",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-bitbucket",
"itemList": [],
"isExternal": false,
@ -933,6 +1023,7 @@
"id": "auth-saml",
"name": "Authenticate via SAML",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-saml",
"itemList": [],
"isExternal": false,
@ -943,6 +1034,7 @@
"id": "auth-saml-managed",
"name": "Authenticate via SAML on Managed Version",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-saml-managed",
"itemList": [],
"isExternal": false,
@ -953,6 +1045,7 @@
"id": "advanced-config",
"name": "Advanced Configuration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/advanced-config",
"itemList": [],
"isExternal": false,
@ -968,6 +1061,7 @@
"id": "auth-single-admin",
"name": "Authenticate with a Single Admin",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-single-admin",
"itemList": [],
"isExternal": false,
@ -978,6 +1072,7 @@
"id": "auth-github",
"name": "Authenticate with GitHub",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-github",
"itemList": [],
"isExternal": false,
@ -988,6 +1083,7 @@
"id": "ami-setup",
"name": "On-Prem VM Setup",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/ami-setup",
"itemList": [],
"isExternal": false,
@ -998,6 +1094,7 @@
"id": "auth-gitlab",
"name": "Authenticate with GitLab",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-gitlab",
"itemList": [],
"isExternal": false,
@ -1008,6 +1105,7 @@
"id": "auth-bitbucket",
"name": "Authenticate with BitBucket",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-bitbucket",
"itemList": [],
"isExternal": false,
@ -1018,6 +1116,7 @@
"id": "auth-saml",
"name": "Authenticate via SAML",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-saml",
"itemList": [],
"isExternal": false,
@ -1028,6 +1127,7 @@
"id": "auth-saml-managed",
"name": "Authenticate via SAML on Managed Version",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/auth-saml-managed",
"itemList": [],
"isExternal": false,
@ -1038,6 +1138,7 @@
"id": "advanced-config",
"name": "Advanced Configuration",
"description": "",
"mediaImage": "",
"file": "nx-cloud/private/advanced-config",
"itemList": [],
"isExternal": false,
@ -1048,12 +1149,14 @@
"id": "other",
"name": "Other",
"description": "Learn how to set up Nx Cloud for your workspace.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "record-commands",
"name": "Record Non-Nx Commands",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/record-commands",
"itemList": [],
"isExternal": false,
@ -1064,6 +1167,7 @@
"id": "ci-deployment",
"name": "Prepare applications for deployment via CI",
"description": "",
"mediaImage": "",
"file": "shared/recipes/ci-deployment",
"itemList": [],
"isExternal": false,
@ -1079,6 +1183,7 @@
"id": "record-commands",
"name": "Record Non-Nx Commands",
"description": "",
"mediaImage": "",
"file": "nx-cloud/set-up/record-commands",
"itemList": [],
"isExternal": false,
@ -1089,6 +1194,7 @@
"id": "ci-deployment",
"name": "Prepare applications for deployment via CI",
"description": "",
"mediaImage": "",
"file": "shared/recipes/ci-deployment",
"itemList": [],
"isExternal": false,
@ -1099,12 +1205,14 @@
"id": "reference",
"name": "Reference",
"description": "Understand how to use Nx Cloud, what arguments and options are available for each component.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "config",
"name": "Configuration Options",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/config",
"itemList": [],
"isExternal": false,
@ -1115,6 +1223,7 @@
"id": "nx-cloud-cli",
"name": "nx-cloud CLI",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/nx-cloud-cli",
"itemList": [],
"isExternal": false,
@ -1125,6 +1234,7 @@
"id": "env-vars",
"name": "Environment Variables",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/env-vars",
"itemList": [],
"isExternal": false,
@ -1135,6 +1245,7 @@
"id": "server-api",
"name": "Server API Reference",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/server-api",
"itemList": [],
"isExternal": false,
@ -1145,6 +1256,7 @@
"id": "release-notes",
"name": "Release Notes",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/release-notes",
"itemList": [],
"isExternal": false,
@ -1160,6 +1272,7 @@
"id": "config",
"name": "Configuration Options",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/config",
"itemList": [],
"isExternal": false,
@ -1170,6 +1283,7 @@
"id": "nx-cloud-cli",
"name": "nx-cloud CLI",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/nx-cloud-cli",
"itemList": [],
"isExternal": false,
@ -1180,6 +1294,7 @@
"id": "env-vars",
"name": "Environment Variables",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/env-vars",
"itemList": [],
"isExternal": false,
@ -1190,6 +1305,7 @@
"id": "server-api",
"name": "Server API Reference",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/server-api",
"itemList": [],
"isExternal": false,
@ -1200,6 +1316,7 @@
"id": "release-notes",
"name": "Release Notes",
"description": "",
"mediaImage": "",
"file": "nx-cloud/reference/release-notes",
"itemList": [],
"isExternal": false,

View File

@ -3,12 +3,14 @@
"id": "intro",
"name": "Intro",
"description": "Learn about plugins.",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "getting-started",
"name": "Getting Started with Plugins",
"description": "Learn how to extend Nx by creating and releasing your own Nx plugin.",
"mediaImage": "",
"file": "shared/plugins/intro",
"itemList": [],
"isExternal": false,
@ -24,6 +26,7 @@
"id": "getting-started",
"name": "Getting Started with Plugins",
"description": "Learn how to extend Nx by creating and releasing your own Nx plugin.",
"mediaImage": "",
"file": "shared/plugins/intro",
"itemList": [],
"isExternal": false,
@ -34,12 +37,14 @@
"id": "tutorials",
"name": "5 Min Tutorials",
"description": "Get started with plugins",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "create-plugin",
"name": "Create a Local Plugin",
"description": "",
"mediaImage": "",
"file": "shared/plugins/create-plugin",
"itemList": [],
"isExternal": false,
@ -50,6 +55,7 @@
"id": "publish-plugin",
"name": "Maintain a Published Plugin",
"description": "",
"mediaImage": "",
"file": "shared/plugins/maintain-published-plugin",
"itemList": [],
"isExternal": false,
@ -65,6 +71,7 @@
"id": "create-plugin",
"name": "Create a Local Plugin",
"description": "",
"mediaImage": "",
"file": "shared/plugins/create-plugin",
"itemList": [],
"isExternal": false,
@ -75,6 +82,7 @@
"id": "publish-plugin",
"name": "Maintain a Published Plugin",
"description": "",
"mediaImage": "",
"file": "shared/plugins/maintain-published-plugin",
"itemList": [],
"isExternal": false,
@ -85,12 +93,14 @@
"id": "recipes",
"name": "Recipes",
"description": "Focused instructions to complete a specific task",
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "local-executors",
"name": "Write a Simple Executor",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/local-executors",
"itemList": [],
"isExternal": false,
@ -101,6 +111,7 @@
"id": "compose-executors",
"name": "Compose Executors",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/compose-executors",
"itemList": [],
"isExternal": false,
@ -111,6 +122,7 @@
"id": "local-generators",
"name": "Write a Simple Generator",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/local-generators",
"itemList": [],
"isExternal": false,
@ -121,6 +133,7 @@
"id": "composing-generators",
"name": "Compose Generators",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/composing-generators",
"itemList": [],
"isExternal": false,
@ -131,6 +144,7 @@
"id": "generator-options",
"name": "Provide Options for Generators",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/generator-options",
"itemList": [],
"isExternal": false,
@ -141,6 +155,7 @@
"id": "creating-files",
"name": "Create Files",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/creating-files",
"itemList": [],
"isExternal": false,
@ -151,6 +166,7 @@
"id": "modifying-files",
"name": "Modify Files",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/modifying-files",
"itemList": [],
"isExternal": false,
@ -161,6 +177,7 @@
"id": "migration-generators",
"name": "Write a Migration",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/migration-generators",
"itemList": [],
"isExternal": false,
@ -171,6 +188,7 @@
"id": "create-preset",
"name": "Create a Preset",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/create-preset",
"itemList": [],
"isExternal": false,
@ -181,6 +199,7 @@
"id": "create-install-package",
"name": "Create an Install Package",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/create-install-package",
"itemList": [],
"isExternal": false,
@ -191,6 +210,7 @@
"id": "project-graph-plugins",
"name": "Modify the Project Graph",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/project-graph-plugins",
"itemList": [],
"isExternal": false,
@ -206,6 +226,7 @@
"id": "local-executors",
"name": "Write a Simple Executor",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/local-executors",
"itemList": [],
"isExternal": false,
@ -216,6 +237,7 @@
"id": "compose-executors",
"name": "Compose Executors",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/compose-executors",
"itemList": [],
"isExternal": false,
@ -226,6 +248,7 @@
"id": "local-generators",
"name": "Write a Simple Generator",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/local-generators",
"itemList": [],
"isExternal": false,
@ -236,6 +259,7 @@
"id": "composing-generators",
"name": "Compose Generators",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/composing-generators",
"itemList": [],
"isExternal": false,
@ -246,6 +270,7 @@
"id": "generator-options",
"name": "Provide Options for Generators",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/generator-options",
"itemList": [],
"isExternal": false,
@ -256,6 +281,7 @@
"id": "creating-files",
"name": "Create Files",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/creating-files",
"itemList": [],
"isExternal": false,
@ -266,6 +292,7 @@
"id": "modifying-files",
"name": "Modify Files",
"description": "",
"mediaImage": "",
"file": "shared/recipes/generators/modifying-files",
"itemList": [],
"isExternal": false,
@ -276,6 +303,7 @@
"id": "migration-generators",
"name": "Write a Migration",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/migration-generators",
"itemList": [],
"isExternal": false,
@ -286,6 +314,7 @@
"id": "create-preset",
"name": "Create a Preset",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/create-preset",
"itemList": [],
"isExternal": false,
@ -296,6 +325,7 @@
"id": "create-install-package",
"name": "Create an Install Package",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/create-install-package",
"itemList": [],
"isExternal": false,
@ -306,6 +336,7 @@
"id": "project-graph-plugins",
"name": "Modify the Project Graph",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/project-graph-plugins",
"itemList": [],
"isExternal": false,

File diff suppressed because it is too large Load Diff

View File

@ -354,6 +354,7 @@
{
"name": "Nx and Turborepo",
"id": "turbo-and-nx",
"mediaImage": "./shared/guides/nx-media-monorepo.jpg",
"file": "shared/guides/turbo-and-nx"
},
{

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -95,6 +95,7 @@ export class DocumentsApi {
filePath: this.getFilePath(document.file),
id: document.id,
name: document.name,
mediaImage: document.mediaImage || '',
relatedDocuments: this.getRelatedDocuments(document.tags),
tags: document.tags,
};

View File

@ -40,6 +40,7 @@ export function DocViewer({
const vm = {
title: metadata['title'] ?? document.name,
description: metadata['description'] ?? document.description,
mediaImage: document.mediaImage,
content: node,
relatedContent: renderMarkdown(
generateRelatedDocumentsTemplate(
@ -52,6 +53,11 @@ export function DocViewer({
tableOfContent: collectHeadings(treeNode),
};
function getExtension(path: string): string {
const splits = path.split('.');
return splits[splits.length - 1];
}
return (
<>
<NextSeo
@ -68,11 +74,11 @@ export function DocViewer({
'Next generation build system with first class monorepo support and powerful integrations.',
images: [
{
url: router.asPath.includes('turbo-and-nx')
? 'https://nx.dev/socials/nx-media-monorepo.jpg'
: `https://nx.dev/images/open-graph/${router.asPath
.replace('/', '')
.replace(/\//gi, '-')}.jpg`,
url: `https://nx.dev/images/open-graph/${router.asPath
.replace('/', '')
.replace(/\//gi, '-')}.${
vm.mediaImage ? getExtension(vm.mediaImage) : 'jpg'
}`,
width: 1600,
height: 800,
alt: 'Nx: Smart, Fast and Extensible Build System',

View File

@ -13,6 +13,7 @@ export interface DocumentMetadata {
id: string;
name: string;
description: string;
mediaImage?: string;
file: string;
path: string;
isExternal: boolean;
@ -23,6 +24,7 @@ export interface DocumentMetadata {
export interface ProcessedDocument {
content: string;
description: string;
mediaImage?: string;
filePath: string;
id: string;
name: string;

View File

@ -30,6 +30,7 @@ export function convertToDocumentMetadata(
id: target.id,
name: target.name ?? '',
description: target.description ?? '',
mediaImage: target.mediaImage ?? '',
file: target.file ?? '',
itemList: target.itemList
? target.itemList.map((item) => convertToDocumentMetadata(item))

View File

@ -37,6 +37,10 @@
"type": "string",
"description": "Description for the item"
},
"mediaImage": {
"type": "string",
"description": "Path to an alternate open graph image, relative to /docs"
},
"file": {
"type": "string",
"description": "Path to the markdown file"

View File

@ -1,6 +1,12 @@
import { Canvas, Image, SKRSContext2D } from '@napi-rs/canvas';
import { PackageMetadata } from '../../../nx-dev/models-package/src/lib/package.models';
import { ensureDir, readFile, readJSONSync, writeFileSync } from 'fs-extra';
import {
ensureDir,
readFile,
readJSONSync,
writeFileSync,
copyFileSync,
} from 'fs-extra';
import { resolve } from 'path';
const mapJson = readJSONSync('./docs/map.json', 'utf8').content;
@ -35,7 +41,12 @@ const targetFolder: string = resolve(
`./nx-dev/nx-dev/public/images/open-graph`
);
const data: { title: string; content: string; filename: string }[] = [];
const data: {
title: string;
content: string;
mediaImage?: string;
filename: string;
}[] = [];
documents.forEach((category) => {
data.push({
title: category.name,
@ -46,6 +57,7 @@ documents.forEach((category) => {
data.push({
title: item.name,
content: item.description || category.name,
mediaImage: item.mediaImage,
filename: [category.sidebarId, category.id, item.id]
.filter(Boolean)
.join('-'),
@ -54,6 +66,7 @@ documents.forEach((category) => {
data.push({
title: subItem.name,
content: subItem.description || category.name,
mediaImage: subItem.mediaImage,
filename: [category.sidebarId, category.id, item.id, subItem.id]
.filter(Boolean)
.join('-'),
@ -146,6 +159,19 @@ function createOpenGraphImage(
});
}
function copyImage(
backgroundImagePath: string,
targetFolder: string,
filename: string
) {
const splits = backgroundImagePath.split('.');
const extension = splits[splits.length - 1];
copyFileSync(
backgroundImagePath,
resolve(targetFolder, `./${filename}.${extension}`)
);
}
function splitLines(
context: SKRSContext2D,
text: string,
@ -180,12 +206,18 @@ console.log(
);
ensureDir(targetFolder).then(() =>
data.map((item) =>
createOpenGraphImage(
resolve(__dirname, './media.jpg'),
targetFolder,
item.title,
item.content,
item.filename
)
item.mediaImage
? copyImage(
resolve(__dirname, '../../../docs/' + item.mediaImage),
targetFolder,
item.filename
)
: createOpenGraphImage(
resolve(__dirname, './media.jpg'),
targetFolder,
item.title,
item.content,
item.filename
)
)
);