Skip to content

Commit

Permalink
Merge branch 'test-vale' into ly-test-linter2
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Sep 27, 2024
2 parents a8a4eb3 + 0433214 commit f4d1168
Show file tree
Hide file tree
Showing 131 changed files with 1,072 additions and 844 deletions.
88 changes: 0 additions & 88 deletions contributing/single-sourcing-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,94 +132,6 @@ $ dbt test --models [...] --defer --state path/to/artifacts
</VersionBlock>
```

## Using global variables

---

Global variables can be configured for use throughout the docs.

Using a global variable requires two steps:

1. Set the variable in the `website/dbt-global-variables.js` file.
2. Use the **Var** component to add the global variable to a page.

```jsx
// The dbtCore property is the identifier for the variable,
// while the name property is the value shown on the page.

exports.dbtVariables = {
dbtCore: {
name: "dbt Core"
}
}
```

```markdown
// <Var name="dbtCore" /> is converted to dbt Core

You can install <Var name="dbtCore" /> on the command line by using one of these recommended methods:
```

### Versioning global variables

It is possible to version global variables as well. This creates the ability to show different variations of a string based off the current version a visitor has selected.

To extend our `dbt-global-variables.js` file above, we can add a new variable: *note - these versions are not accurate and only shown for this example.*

```jsx
// A new variable called dbtCloud is added below
// This variable includes a versions array
// "Sinter" will replace "dbt Cloud" for versions 0.21 or lower

exports.dbtVariables = {
dbtCore: {
name: "dbt Core"
},
dbtCloud: {
name: "dbt Cloud",
versions: [
{
"name": "Sinter",
"version": "0.21"
}
]
}
}
```

```markdown
You can get started with <Var name="dbtCloud" /> by [Signing up](https://www.getdbt.com/signup/).
```

In the above example, the **dbtCloud** property has a default name of “dbt Cloud”. The naming for variables cascade down, meaning “dbt Cloud” will show for all versions, until version **0.21** or lower is selected. At that point “Sinter” will replace “dbt Cloud”.

### Global variables properties

**name** (required): Expects the identifier for a global variable.

### Global variables example

The global `<Var />` component can be used inline, for example:

```markdown
This piece of markdown content explains why <Var name="dbt" /> is awesome.
```

However, a Var component cannot start a new line of content. Fortunately, a workaround exists to use the Var component at the beginning of a line of content.

To use the component at the beginning of a sentence, add a non-breaking space character before the component:

```markdown
// When starting a new line with a global variable,
// a non-breaking space is required

// Works
&nbsp;<Var name="dbt" /> is awesome!

// Does not work
<Var name="dbt" /> is awesome!
```

## Reusing content

To reuse content on different pages, you can use some techniques like partial files or snippets. Partial files, a built-in Docusaurus feature, is the recommended method over snippets.
Expand Down
32 changes: 0 additions & 32 deletions website/dbt-global-variables.js

This file was deleted.

164 changes: 82 additions & 82 deletions website/dbt-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Sets the available dbt versions available in the navigation
* @type {Array.<{
* version: string,
* EOLDate: string,
* isPrerelease: boolean,
* EOLDate: string,
* isPrerelease: boolean,
* customDisplay: string,
* }>}
* @property {string} version The version number
* @property {string} EOLDate "End of Life" date which is used to show the EOL banner
* @property {boolean} isPrerelease Boolean used for showing the prerelease banner
* @property {string} customDisplay Allows setting a custom display name for the current version
*
*
* customDisplay for dbt Cloud should be a version ahead of latest dbt Core release (GA or beta).
*/
exports.versions = [
Expand All @@ -30,7 +30,7 @@ exports.versions = [
version: "1.6",
EOLDate: "2024-07-31",
},
]
];

/**
* Controls doc page visibility in the sidebar based on the current version
Expand All @@ -43,146 +43,146 @@ exports.versions = [
*/
exports.versionedPages = [
{
"page": "/reference/resource-configs/target_database",
"lastVersion": "1.8",
page: "reference/resource-configs/target_database",
lastVersion: "1.8",
},
{
"page": "/reference/resource-configs/target_schema",
"lastVersion": "1.8",
page: "reference/resource-configs/target_schema",
lastVersion: "1.8",
},
{
"page": "reference/global-configs/indirect-selection",
"firstVersion": "1.8",
page: "reference/global-configs/indirect-selection",
firstVersion: "1.8",
},
{
"page": "reference/resource-configs/store_failures_as",
"firstVersion": "1.7",
page: "reference/resource-configs/store_failures_as",
firstVersion: "1.7",
},
{
"page": "docs/build/build-metrics-intro",
"firstVersion": "1.6",
page: "docs/build/build-metrics-intro",
firstVersion: "1.6",
},
{
"page": "docs/build/sl-getting-started",
"firstVersion": "1.6",
page: "docs/build/sl-getting-started",
firstVersion: "1.6",
},
{
"page": "docs/build/about-metricflow",
"firstVersion": "1.6",
page: "docs/build/about-metricflow",
firstVersion: "1.6",
},
{
"page": "docs/build/join-logic",
"firstVersion": "1.6",
page: "docs/build/join-logic",
firstVersion: "1.6",
},
{
"page": "docs/build/validation",
"firstVersion": "1.6",
page: "docs/build/validation",
firstVersion: "1.6",
},
{
"page": "docs/build/semantic-models",
"firstVersion": "1.6",
page: "docs/build/semantic-models",
firstVersion: "1.6",
},
{
"page": "docs/build/group-by",
"firstVersion": "1.6",
page: "docs/build/group-by",
firstVersion: "1.6",
},
{
"page": "docs/build/entities",
"firstVersion": "1.6",
page: "docs/build/entities",
firstVersion: "1.6",
},
{
"page": "docs/build/metrics-overview",
"firstVersion": "1.6",
page: "docs/build/metrics-overview",
firstVersion: "1.6",
},
{
"page": "docs/build/cumulative",
"firstVersion": "1.6",
page: "docs/build/cumulative",
firstVersion: "1.6",
},
{
"page": "docs/build/derived",
"firstVersion": "1.6",
page: "docs/build/derived",
firstVersion: "1.6",
},
{
"page": "docs/build/measure-proxy",
"firstVersion": "1.6",
page: "docs/build/measure-proxy",
firstVersion: "1.6",
},
{
"page": "docs/build/ratio",
"firstVersion": "1.6",
page: "docs/build/ratio",
firstVersion: "1.6",
},
{
"page": "reference/commands/clone",
"firstVersion": "1.6",
page: "reference/commands/clone",
firstVersion: "1.6",
},
{
"page": "docs/collaborate/govern/project-dependencies",
"firstVersion": "1.6",
page: "docs/collaborate/govern/project-dependencies",
firstVersion: "1.6",
},
{
"page": "reference/dbt-jinja-functions/thread_id",
"firstVersion": "1.6",
page: "reference/dbt-jinja-functions/thread_id",
firstVersion: "1.6",
},
{
"page": "reference/resource-properties/deprecation_date",
"firstVersion": "1.6",
page: "reference/resource-properties/deprecation_date",
firstVersion: "1.6",
},
{
"page": "reference/commands/retry",
"firstVersion": "1.6",
page: "reference/commands/retry",
firstVersion: "1.6",
},
{
"page": "docs/build/groups",
"firstVersion": "1.5",
page: "docs/build/groups",
firstVersion: "1.5",
},
{
"page": "docs/collaborate/govern/model-contracts",
"firstVersion": "1.5",
page: "docs/collaborate/govern/model-contracts",
firstVersion: "1.5",
},
{
"page": "reference/commands/show",
"firstVersion": "1.5",
page: "reference/commands/show",
firstVersion: "1.5",
},
{
"page": "docs/collaborate/govern/model-access",
"firstVersion": "1.5",
page: "docs/collaborate/govern/model-access",
firstVersion: "1.5",
},
{
"page": "docs/collaborate/govern/model-versions",
"firstVersion": "1.5",
page: "docs/collaborate/govern/model-versions",
firstVersion: "1.5",
},
{
"page": "reference/programmatic-invocations",
"firstVersion": "1.5",
page: "reference/programmatic-invocations",
firstVersion: "1.5",
},
{
"page": "reference/resource-configs/contract",
"firstVersion": "1.5",
page: "reference/resource-configs/contract",
firstVersion: "1.5",
},
{
"page": "reference/resource-configs/group",
"firstVersion": "1.5",
page: "reference/resource-configs/group",
firstVersion: "1.5",
},
{
"page": "reference/resource-properties/access",
"firstVersion": "1.5",
page: "reference/resource-properties/access",
firstVersion: "1.5",
},
{
"page": "reference/resource-properties/constraints",
"firstVersion": "1.5",
page: "reference/resource-properties/constraints",
firstVersion: "1.5",
},
{
"page": "reference/resource-properties/latest_version",
"firstVersion": "1.5",
page: "reference/resource-properties/latest_version",
firstVersion: "1.5",
},
{
"page": "reference/resource-properties/versions",
"firstVersion": "1.5",
page: "reference/resource-properties/versions",
firstVersion: "1.5",
},
{
"page": "reference/resource-configs/on_configuration_change",
"firstVersion": "1.6",
}
]
page: "reference/resource-configs/on_configuration_change",
firstVersion: "1.6",
},
];

/**
* Controls doc category visibility in the sidebar based on the current version
Expand All @@ -195,11 +195,11 @@ exports.versionedPages = [
*/
exports.versionedCategories = [
{
"category": "Model governance",
"firstVersion": "1.5",
category: "Model governance",
firstVersion: "1.5",
},
{
"category": "Build your metrics",
"firstVersion": "1.6",
}
]
category: "Build your metrics",
firstVersion: "1.6",
},
];
Loading

0 comments on commit f4d1168

Please sign in to comment.