updated page title generation and other templated items

pull/1387/head
Scott Anderson 2020-07-29 15:58:28 -06:00
parent 17e420c1e5
commit 815db04ac7
4 changed files with 26 additions and 14 deletions

View File

@ -4,7 +4,7 @@ description: >
Learn how to use and leverage InfluxDB in use cases such as monitoring metrics, IoT data, and events. Learn how to use and leverage InfluxDB in use cases such as monitoring metrics, IoT data, and events.
layout: version-landing layout: version-landing
menu: menu:
versions: influxdb:
name: v2.0 name: v2.0
aliases: aliases:
- /v2.0/ - /v2.0/

View File

@ -1,5 +1,9 @@
{{ partial "header.html" . }} {{ partial "header.html" . }}
{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }}
{{ $product := index $productPathData 0 }}
{{ $currentVersion := index $productPathData 1 }}
<div class="page-wrapper"> <div class="page-wrapper">
{{ partial "sidebar.html" . }} {{ partial "sidebar.html" . }}
<div class="content-wrapper"> <div class="content-wrapper">
@ -7,8 +11,7 @@
<div class="cards"> <div class="cards">
<div class="card main" id="get-started"> <div class="card main" id="get-started">
{{ $currentVersion := replaceRE "v" "" (index (findRE "[^/]+.*?" .RelPermalink) 0) }} <h1>Get started with InfluxDB {{ replaceRE "v" "" $currentVersion }}</h1>
<h1>Get started with InfluxDB {{ $currentVersion }}</h1>
<a class="btn" href="get-started/#start-with-influxdb-cloud-2-0">Start with InfluxDB Cloud</a> <a class="btn" href="get-started/#start-with-influxdb-cloud-2-0">Start with InfluxDB Cloud</a>
<a class="btn oss" href="get-started/#start-with-influxdb-oss">Start with InfluxDB OSS</a> <a class="btn oss" href="get-started/#start-with-influxdb-oss">Start with InfluxDB OSS</a>
</div> </div>

View File

@ -1,12 +1,19 @@
{{ $currentVersion := replaceRE "v" "" (index (findRE "[^/]+.*?" .RelPermalink) 0) }} {{ $productPathData := findRE "[^/]+.*?" .RelPermalink }}
{{ $product := index $productPathData 0 }}
{{ $currentVersion := index $productPathData 1 }}
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
{{ partial "header/google-analytics-head.html" }} {{ partial "header/google-analytics-head.html" }}
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
{{ if in .RelPermalink "/cloud/"}} {{ if eq $product nil }}
<title>{{ if .Params.seotitle }} {{ print .Params.seotitle " | " }} {{ else if .Title }} {{ print .Title " | " }}{{ end }}{{ .Site.Data.products.cloud.name }} Documentation</title> <title>InfluxData Documentation</title>
{{ else if eq $currentVersion nil}}
<title>{{ (index .Site.Data.products $product).name }} Documentation</title>
{{ else if eq (len $productPathData) 2 }}
<title>{{ (index .Site.Data.products $product).name }} {{ $currentVersion }} Documentation</title>
{{ else }} {{ else }}
<title>{{ if .Params.seotitle }} {{ print .Params.seotitle " | " }} {{ else if .Title }} {{ print .Title " | " }} {{ end }}InfluxDB {{ if $currentVersion }}{{print $currentVersion " " }}{{ end }}Documentation</title> <title>{{ if .Params.seotitle }} {{ print .Params.seotitle " | " }} {{ else if .Title }} {{ print .Title " | " }} {{ end }}InfluxDB {{ if $currentVersion }}{{print $currentVersion " " }}{{ end }}Documentation</title>
{{ end }} {{ end }}

View File

@ -1,3 +1,7 @@
{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }}
{{ $product := index $productPathData 0 }}
{{ $currentVersion := index $productPathData 1 }}
<div class="topnav"> <div class="topnav">
<div class="topnav--left"> <div class="topnav--left">
<a class="influx-home" href="https://www.influxdata.com" title="InfluxData"><span class="icon-influx-logo"></span><span class="icon-influx-logotype"></span></a> <a class="influx-home" href="https://www.influxdata.com" title="InfluxData"><span class="icon-influx-logo"></span><span class="icon-influx-logotype"></span></a>
@ -5,22 +9,20 @@
<a class="docs-home" href="/{{ $.Site.Data.versions.stable_version }}">InfluxDB Docs</a> <a class="docs-home" href="/{{ $.Site.Data.versions.stable_version }}">InfluxDB Docs</a>
</div> </div>
<div class="topnav--right"> <div class="topnav--right">
{{ if or (eq $product nil) (eq $currentVersion nil) }}
{{ else }}
<div class="version-selector"> <div class="version-selector">
{{- $currentVersion := (index (findRE "[^/]+.*?" .RelPermalink) 0) -}} <p class="selected">{{ $currentVersion }}</p>
{{ if not ( in $currentVersion "v2") }}
<p class="selected">Select Version</p>
{{ else }}
<p class="selected">{{ $currentVersion }}</p>
{{ end }}
<ul class="version-list"> <ul class="version-list">
{{ range .Site.Menus.versions.ByName.Reverse }} {{ range (index .Site.Menus $product).ByName.Reverse }}
<li> <li>
<a href="{{ .URL }}">{{ .Name }}</a> <a href="{{ .URL }}">{{ .Name }}</a>
</li> </li>
{{ end }} {{ end }}
<li><a href="https://docs.influxdata.com" class="legacy" target="_blank">v1.x</a></li> <li><a href="https://github.com/influxdata/docs.influxdata.com" class="legacy" target="_blank">v0.x</a></li>
</ul> </ul>
</div> </div>
{{ end }}
<button id="search-btn" onclick="toggle_sidebar('sidebar-open');document.getElementById('algolia-search-input').focus();return false;"><span class="icon-search"></span></button> <button id="search-btn" onclick="toggle_sidebar('sidebar-open');document.getElementById('algolia-search-input').focus();return false;"><span class="icon-search"></span></button>
<button class="url-trigger" href="#"><span class="icon-ui-cog-thick"></span></button> <button class="url-trigger" href="#"><span class="icon-ui-cog-thick"></span></button>
<button class="theme-switcher" id="theme-switch-light" onclick="switch_style('light-theme');return false;"><span class="icon-sun1"></span></button> <button class="theme-switcher" id="theme-switch-light" onclick="switch_style('light-theme');return false;"><span class="icon-sun1"></span></button>