2016-07-15 17:10:12 -04:00
|
|
|
// template: public/_includes/_hero
|
|
|
|
//- Refer to jade.template.html and addJadeDataDocsProcessor to figure out where the context of this jade file originates
|
2016-04-18 15:57:16 -04:00
|
|
|
- var textFormat = '';
|
2015-08-19 19:12:16 -04:00
|
|
|
- var headerTitle = title + (typeof varType !== 'undefined' ? (': ' + varType) : '');
|
2016-04-18 15:57:16 -04:00
|
|
|
- var capitalize = function capitalize(str) { return str.charAt(0).toUpperCase() + str.slice(1); }
|
|
|
|
- var useBadges = docType || stability;
|
2016-07-15 17:10:12 -04:00
|
|
|
//- renamer :: String -> String
|
|
|
|
//- Renames `Let` and `Var` into `Const`
|
2016-05-16 11:35:01 -04:00
|
|
|
- var renamer = function renamer(docType) {
|
|
|
|
- return (docType === 'Let' || docType === 'Var') ? 'Const' : docType
|
|
|
|
- }
|
|
|
|
|
2015-05-01 09:04:23 -04:00
|
|
|
if current.path[4] && current.path[3] == 'api'
|
2015-07-28 02:39:47 -04:00
|
|
|
- var textFormat = 'is-standard-case'
|
2015-05-01 09:04:23 -04:00
|
|
|
|
2016-07-15 17:10:12 -04:00
|
|
|
header(class="hero background-sky", style=fixHeroCss ? "height:auto" : "")
|
2016-04-26 12:15:34 -04:00
|
|
|
div(class="inner-header")
|
2016-06-29 01:11:23 -04:00
|
|
|
h1(class="hero-title text-display-1 translated-cn #{textFormat}") #{headerTitle}
|
2016-04-26 12:15:34 -04:00
|
|
|
if useBadges
|
2016-04-22 17:25:55 -04:00
|
|
|
span(class="badges")
|
|
|
|
if docType
|
|
|
|
span(class="status-badge").
|
2016-05-16 11:35:01 -04:00
|
|
|
#{renamer(capitalize(docType))}
|
2016-04-22 17:25:55 -04:00
|
|
|
if stability
|
|
|
|
span(layout="row" class="status-badge")
|
|
|
|
// badge circle is filled based on stability by matching a css selector in _hero.scss
|
|
|
|
span(class="status-circle status-#{stability}")
|
|
|
|
span Stability: #{capitalize(stability)}
|
2016-05-09 14:22:34 -04:00
|
|
|
if security
|
|
|
|
span(class="status-badge security-risk-badge").
|
|
|
|
Security Risk
|
2015-03-01 09:42:31 -05:00
|
|
|
|
|
|
|
if subtitle
|
|
|
|
h2.hero-subtitle.text-subhead #{subtitle}
|
|
|
|
|
2016-07-15 17:10:12 -04:00
|
|
|
else if current.path[3] == 'api' && current.path[1] == 'dart'
|
|
|
|
block breadcrumbs
|
2016-08-24 17:48:23 -04:00
|
|
|
//- Show cross-language menu for top-level API page (but not entry pages)
|
|
|
|
if ! public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]
|
|
|
|
!= partial("_version-dropdown")
|
2015-03-01 09:42:31 -05:00
|
|
|
else if current.path[0] == "docs"
|
2016-04-18 15:57:16 -04:00
|
|
|
!= partial("_version-dropdown")
|