Fix shared files (#2856)

* fix: negate check for verbose.

* fix: default version directory to latest version.

* update: API changes.

* update: API updated with grammar fixes

* fix: move assets/text to shared/text
pull/2857/head
Jason Stirnaman 2021-07-15 17:21:52 -05:00 committed by GitHub
parent 01e6ae7c7d
commit 5868957535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 34 additions and 34 deletions

View File

@ -669,16 +669,16 @@ list_code_example: |
~~~
#### Organize and include native code examples
To include text from a file in `/assets/text/`, use the
`{{< get-assets-text >}}` shortcode and provide the relative path and filename.
To include text from a file in `/shared/text/`, use the
`{{< get-shared-text >}}` shortcode and provide the relative path and filename.
This is useful for maintaining and referencing sample code variants in their
native file formats.
1. Store code examples in their native formats at `/assets/text/`.
1. Store code examples in their native formats at `/shared/text/`.
```md
/assets/text/example1/example.js
/assets/text/example1/example.py
/shared/text/example1/example.js
/shared/text/example1/example.py
```
2. Include the files, e.g. in code tabs
@ -690,12 +690,12 @@ This is useful for maintaining and referencing sample code variants in their
{{% /code-tabs %}}
{{% code-tab-content %}}
```js
{{< get-assets-text "example1/example.js" >}}
{{< get-shared-text "example1/example.js" >}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```py
{{< get-assets-text "example1/example.py" >}}
{{< get-shared-text "example1/example.py" >}}
```
{{% /code-tab-content %}}
{{% /code-tabs-wrapper %}}

View File

@ -37,7 +37,7 @@ Use the `influx` CLI to set the schema-type and measurement schemas for your buc
1. Create a bucket with the `schema-type` flag set to `explicit`.
```sh
{{< get-assets-text "bucket-schema/bucket-schema-type.sh" >}}
{{< get-shared-text "bucket-schema/bucket-schema-type.sh" >}}
```
2. Use your text editor to create a schema columns file for each measurement you want to add.
@ -52,17 +52,17 @@ as in the following examples:
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{< get-assets-text "bucket-schema/usage-resources.csv" >}}
{{< get-shared-text "bucket-schema/usage-resources.csv" >}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```json
{{< get-assets-text "bucket-schema/usage-cpu.json" >}}
{{< get-shared-text "bucket-schema/usage-cpu.json" >}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```json
{{< get-assets-text "bucket-schema/sensor.ndjson" >}}
{{< get-shared-text "bucket-schema/sensor.ndjson" >}}
```
{{% /code-tab-content %}}
{{% /code-tabs-wrapper %}}
@ -118,7 +118,7 @@ Use the [`extended-output` flag](/influxdb/cloud/reference/cli/influx/bucket-sch
```sh
# sensor.ndjson
{{< get-assets-text "bucket-schema/sensor.ndjson" >}}
{{< get-shared-text "bucket-schema/sensor.ndjson" >}}
```
```sh

View File

@ -72,7 +72,7 @@ influx bucket create -n my-bucket -o my-org -r 72h
1.
```sh
{{< get-assets-text "bucket-schema/bucket-schema-type.sh" >}}
{{< get-shared-text "bucket-schema/bucket-schema-type.sh" >}}
```
2. Create a bucket schema. For more information, see [Manage bucket schemas](/influxdb/cloud/organizations/buckets/bucket-schema/).

View File

@ -54,12 +54,12 @@ Authorization: Token <token>
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v1-compat/auth/oss/token-auth.sh" %}}
{{% get-shared-text "api/v1-compat/auth/oss/token-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v1-compat/auth/oss/token-auth.js" %}}
{{% get-shared-text "api/v1-compat/auth/oss/token-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
@ -96,12 +96,12 @@ Authorization: Basic <username>:<password>
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v1-compat/auth/oss/basic-auth.sh" %}}
{{% get-shared-text "api/v1-compat/auth/oss/basic-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v1-compat/auth/cloud/basic-auth.js" %}}
{{% get-shared-text "api/v1-compat/auth/cloud/basic-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
@ -132,12 +132,12 @@ Use InfluxDB 1.x API parameters to provide username and password credentials thr
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v1-compat/auth/oss/querystring-auth.sh" %}}
{{% get-shared-text "api/v1-compat/auth/oss/querystring-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v1-compat/auth/oss/querystring-auth.js" %}}
{{% get-shared-text "api/v1-compat/auth/oss/querystring-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}

View File

@ -91,12 +91,12 @@ The following precisions are available:
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v1-compat/auth/cloud/basic-auth.sh" %}}
{{% get-shared-text "api/v1-compat/auth/cloud/basic-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v1-compat/auth/cloud/basic-auth.js" %}}
{{% get-shared-text "api/v1-compat/auth/cloud/basic-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}

View File

@ -43,12 +43,12 @@ Include your authentication token as an `Authorization` header in each request.
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v2.0/auth/oss/token-auth.sh" %}}
{{% get-shared-text "api/v2.0/auth/oss/token-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v2.0/auth/oss/token-auth.js" %}}
{{% get-shared-text "api/v2.0/auth/oss/token-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}

View File

@ -49,12 +49,12 @@ Authorization: Token <token>
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v1-compat/auth/oss/token-auth.sh" %}}
{{% get-shared-text "api/v1-compat/auth/oss/token-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v1-compat/auth/oss/token-auth.js" %}}
{{% get-shared-text "api/v1-compat/auth/oss/token-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
@ -103,12 +103,12 @@ Authorization: Basic <username>:<password>
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v1-compat/auth/oss/basic-auth.sh" %}}
{{% get-shared-text "api/v1-compat/auth/oss/basic-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v1-compat/auth/oss/basic-auth.js" %}}
{{% get-shared-text "api/v1-compat/auth/oss/basic-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
@ -139,12 +139,12 @@ Use InfluxDB 1.x API parameters to provide credentials through the query string.
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{< get-assets-text "api/v1-compat/auth/oss/querystring-auth.sh" >}}
{{< get-shared-text "api/v1-compat/auth/oss/querystring-auth.sh" >}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{< get-assets-text "api/v1-compat/auth/oss/querystring-auth.js" >}}
{{< get-shared-text "api/v1-compat/auth/oss/querystring-auth.js" >}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}

View File

@ -96,12 +96,12 @@ The following precisions are available:
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
{{% get-assets-text "api/v1-compat/auth/oss/basic-auth.sh" %}}
{{% get-shared-text "api/v1-compat/auth/oss/basic-auth.sh" %}}
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```js
{{% get-assets-text "api/v1-compat/auth/oss/basic-auth.js" %}}
{{% get-shared-text "api/v1-compat/auth/oss/basic-auth.js" %}}
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}

View File

@ -101,5 +101,5 @@ For more information, see [Manage bucket schema](/influxdb/cloud/organizations/b
{{% /cloud %}}
```sh
{{< get-assets-text "bucket-schema/bucket-schema-type.sh" >}}
{{< get-shared-text "bucket-schema/bucket-schema-type.sh" >}}
```

View File

@ -1,2 +0,0 @@
{{- $file := resources.Get (printf "text/%s" ($.Get 0)) -}}
{{- $file.Content | safeHTML -}}

View File

@ -0,0 +1,2 @@
{{- $file := (printf "/shared/text/%s" ($.Get 0)) -}}
{{- readFile $file | safeHTML -}}