Merge pull request #88 from influxdata/cloud-enterprise-shortcodes

Added cloud shortcodes and styles, adjusted enterprise shortcode, upd…
pull/96/head
Scott Anderson 2019-03-13 14:06:05 -06:00 committed by GitHub
commit 6c43a91e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 165 additions and 43 deletions

View File

@ -62,6 +62,8 @@ weight: # Determines sort order in both the nav tree and in article lists.
draft: # If true, will not render page on build
enterprise_all: # If true, specifies the doc as a whole is specific to InfluxDB Enterprise
enterprise_some: # If true, specifies the doc includes some content specific to InfluxDB Enterprise
cloud_all: # If true, specifies the doc as a whole is specific to InfluxCloud
cloud_some: # If true, specifies the doc includes some content specific to InfluxCloud
v2.x/tags: # Tags specific to each version (replace .x" with the appropriate minor version )
```
@ -135,6 +137,55 @@ Insert enterprise-specific markdown content here.
{{% /enterprise %}}
```
#### Enterprise name
The name used to refer to InfluxData's enterprise offering is subject to change.
To facilitate easy updates in the future, use the `enterprise-name` shortcode when referencing the enterprise product.
```
This is content that references {{< enterprise-name >}}.
```
The product name is stored in `data/products.yml`
### InfluxCloud Content
Some articles are unique to InfluxCloud or at least contain some information specific to InfluxCloud.
There are frontmatter options and an cloud shortcode that help to properly identify this content.
#### All content is cloud-specific
If all content in an article is cloud-specific, set the `cloud_all` frontmatter to `true`.
```yaml
cloud_all: true
```
This will display a message at the top of page indicating that the things discussed are unique to InfluxCloud.
#### Only some content is cloud-specific
If only some content in the article is cloud-specific, set the `cloud_some` frontmatter to `true`.
```yaml
cloud_some: true
```
This will display a message at the top of page indicating some things are unique to InfluxCloud.
To format cloud-specific content, wrap it in the `{{% cloud %}}` shortcode:
```md
{{% cloud %}}
Insert enterprise-specific markdown content here.
{{% /cloud %}}
```
#### InfluxCloud name
The name used to refer to InfluxData's cloud offering is subject to change.
To facilitate easy updates in the future, use the `cloud-name` short-code when referencing the cloud product.
```
This is content that references {{< cloud-name >}}.
```
The product name is stored in `data/products.yml`
### Tabbed Content
Shortcodes are available for creating "tabbed" content (content that is changed by a users' selection).
Ther following three must be used:

View File

@ -272,7 +272,8 @@
.feedback,
.note,
.warn,
.enterprise-msg {
.enterprise-msg,
.cloud-msg {
padding: 1.65rem 2rem .1rem 2rem;
margin: 1rem 0 2rem;
border-width: 0 0 0 4px;
@ -391,44 +392,67 @@
///////////////////////////////// Enterprise /////////////////////////////////
.enterprise-msg {
border-color: $article-enterprise-base;
background: rgba($article-enterprise-base, .15);
font-style: italic;
display: flex;
p {
color: $article-enterprise-text;
}
a {
color: $article-enterprise-link;
&:hover {
color: $article-enterprise-link-hover;
}
}
div:first-child { margin-right: 1.25rem; }
}
.enterprise, .cloud {
position: relative;
padding: 0 0 .01rem 2rem;
margin-left: -2rem;
.enterprise-flag {
padding: .2rem .4rem;
background: $article-enterprise-base;
font-size: .75rem;
font-style: normal;
font-weight: bold;
color: $g20-white;
border-radius: $border-radius;
vertical-align: text-bottom;
&:before {
content: "E";
&-msg {
font-style: italic;
display: flex;
div:first-child { margin-right: 1.25rem; }
}
&-flag {
padding: .2rem .4rem;
font-size: .75rem;
font-style: normal;
font-weight: bold;
color: $g20-white;
border-radius: $border-radius;
vertical-align: text-bottom;
}
}
.enterprise {
position: relative;
padding: 0 0 .01rem 2rem;
margin-left: -2rem;
border-left: 2px solid $article-enterprise-base;
&-msg {
border-color: $article-enterprise-base;
background: rgba($article-enterprise-base, .15);
p { color: $article-enterprise-text; }
a {
color: $article-enterprise-link;
&:hover { color: $article-enterprise-link-hover; }
}
}
&-flag {
background: $article-enterprise-base;
&:before {
content: "E";
}
}
}
.enterprise-flag {
.cloud {
border-left: 2px solid $article-cloud-base;
&-msg {
border-color: $article-cloud-base;
background: rgba($article-cloud-base, .15);
p { color: $article-cloud-text; }
a {
color: $article-cloud-link;
&:hover { color: $article-cloud-link-hover; }
}
}
&-flag {
background: $article-cloud-base;
&:before {
content: "C";
}
}
}
.enterprise, .cloud {
.enterprise-flag, .cloud-flag {
position: absolute;
top: -.15rem;
left: -.68rem;
@ -695,16 +719,17 @@
blockquote,
.note,
.warn,
#enterprise-msg {
.enterprise-msg,
.cloud-msg {
padding: 1.35rem 1.25rem .1rem 1.25rem;
margin: .5rem 0 1rem;
}
.enterprise {
.enterprise, .cloud {
padding: 0 0 .01rem .85rem;
margin-left: -.85rem;
.enterprise-flag {
.enterprise-flag, .cloud-flag {
left: -.25rem;
}
}

View File

@ -105,6 +105,11 @@ $article-enterprise-text: $p-potassium !default;
$article-enterprise-link: $p-moonstone !default;
$article-enterprise-link-hover: $g20-white !default;
$article-cloud-base: $b-pool !default;
$article-cloud-text: $b-neutrino !default;
$article-cloud-link: $b-snow !default;
$article-cloud-link-hover: $g20-white !default;
// Article Tabs for tabbed content
$article-tab-text: $g12-forge !default;
$article-tab-bg: $g4-onyx !default;

View File

@ -104,6 +104,11 @@ $article-enterprise-text: $p-star;
$article-enterprise-link: $p-star;
$article-enterprise-link-hover: $b-ocean;
$article-cloud-base: $b-laser;
$article-cloud-text: $b-ocean;
$article-cloud-link: $b-ocean;
$article-cloud-link-hover: $gr-canopy;
// Article Tabs for tabbed content
$article-tab-text: $g8-storm;
$article-tab-bg: $g18-cloud;

View File

@ -7,6 +7,8 @@ menu:
weight: 1
#enterprise_all: true
enterprise_some: true
cloud_all: true
#cloud_some: true
draft: true
"v2.0/tags": [influxdb]
---
@ -77,6 +79,7 @@ There is a horizontal rule above and below this line.
---
{{% cloud %}}
#### Inline Styles
This is an [inline link](#). This is `inline code`.
This is an [`inline code link`](#).
@ -160,7 +163,7 @@ avg_cpu
|> yield()
//
```
{{% /cloud %}}
{{% enterprise %}}
###### This is a table

7
data/products.yml Normal file
View File

@ -0,0 +1,7 @@
enterprise:
name: "InfluxDB 2.0 Enterprise"
link: "#"
cloud:
name: "InfluxCloud 2.0 Beta"
link: "https://www.influxdata.com/influxcloud2beta/"

View File

@ -3,6 +3,7 @@
<h1>{{ .Title }}</h1>
{{ partial "article/latest-version.html" . }}
{{ partial "article/enterprise.html" . }}
{{ partial "article/cloud.html" . }}
{{ .Content }}
{{ partial "article/tags.html" . }}
{{ partial "article/_alpha-feedback.html"}}

View File

@ -0,0 +1,20 @@
{{ $cloudName := .Site.Data.products.cloud.name }}
{{ $cloudLink := .Site.Data.products.cloud.link }}
{{ if ( $.Params.cloud_all ) }}
<div class="cloud-msg" id="cloud-msg">
<p>
The features and functionality discussed on this page are unique to <a href="{{ $cloudLink }}" target="_blank">{{ $cloudName }}</a>.
</p>
</div>
{{ else if ( $.Params.cloud_some ) }}
<div class="cloud-msg" id="cloud-msg">
<div>
<span class="cloud-flag"></span>
</div>
<div>
<p>
This page includes features and functionality unique to <a href="{{ $cloudLink }}" target="_blank">{{ $cloudName }}</a>.
</p>
</div>
</div>
{{ end }}

View File

@ -1,20 +1,19 @@
{{ $enterpriseLink := "#"}}
{{ $enterpriseName := .Site.Data.products.enterprise.name }}
{{ $enterpriseLink := .Site.Data.products.enterprise.link }}
{{ if ( $.Params.enterprise_all ) }}
<div class="enterprise-msg">
<div class="enterprise-msg" id="enterprise-msg">
<p>
The features and functionality discussed on this page are unique to the Enterprise edition of InfluxDB.
<a href="{{ $enterpriseLink }}" target="_blank">Learn more about InfluxDB Enterprise</a>.
The features and functionality discussed on this page are unique to <a href="{{ $enterpriseLink }}" target="_blank">{{ $enterpriseName }}</a>.
</p>
</div>
{{ else if ( $.Params.enterprise_some ) }}
<div class="enterprise-msg">
<div class="enterprise-msg" id="enterprise-msg">
<div>
<span class="enterprise-flag"></span>
</div>
<div>
<p>
This page includes features and functionality unique to the Enterprise edition of InfluxDB.
<a href="{{ $enterpriseLink }}" target="_blank">Learn more about InfluxDB Enterprise</a>.
This page includes features and functionality unique to <a href="{{ $enterpriseLink }}" target="_blank">{{ $enterpriseName }}</a>.
</p>
</div>
</div>

View File

@ -0,0 +1 @@
{{ .Site.Data.products.cloud.name }}

View File

@ -0,0 +1,4 @@
<div class="cloud">
<a class="cloud-flag" href="#cloud-msg"></a>
{{ .Inner }}
</div>

View File

@ -0,0 +1 @@
{{ .Site.Data.products.enterprise.name }}