angular-cn/public/_includes/_hero.jade

43 lines
1.8 KiB
Plaintext
Raw Normal View History

// template: public/_includes/_hero
//- Refer to jade.template.html and addJadeDataDocsProcessor to figure out where the context of this jade file originates
- var textFormat = '';
- var headerTitle = title + (typeof varType !== 'undefined' ? (': ' + varType) : '');
- var capitalize = function capitalize(str) { return str.charAt(0).toUpperCase() + str.slice(1); }
- var useBadges = docType || stability;
//- renamer :: String -> String
//- Renames `Let` and `Var` into `Const`
- 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'
- var textFormat = 'is-standard-case'
2015-05-01 09:04:23 -04:00
header(class="hero background-sky", style=fixHeroCss ? "height:auto" : "")
div(class="inner-header")
2016-06-29 01:11:23 -04:00
h1(class="hero-title text-display-1 translated-cn #{textFormat}") #{headerTitle}
if useBadges
span(class="badges")
if docType
span(class="status-badge").
#{renamer(capitalize(docType))}
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)}
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}
else if current.path[3] == 'api' && current.path[1] == 'dart'
block breadcrumbs
//- 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"
!= partial("_version-dropdown")