angular-cn/public/_includes/_hero.jade

42 lines
1.4 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
if current.path.indexOf('cheatsheet') > 0 || current.path[current.path.length-2] === 'api'
- var base = current.path[4] ? '../guide' : './guide';
2017-03-23 23:07:17 -04:00
- var ngVersion = '(v<ngio-cheatsheet src="' + base + '/cheatsheet.json" version-only>4.X.Y</ngio-cheatsheet>)';
header.hero.background-sky
h1(class="hero-title #{textFormat}") #{headerTitle} !{ngVersion}
if useBadges
if stability
span(class="badge is-#{stability}").
#{capitalize(stability)}
if security
span(class="badge is-deprecated").
安全风险
//- CLEAR FLOAT ELEMENTS
.clear
2015-03-01 09:42:31 -05:00
if subtitle
h2.hero-subtitle #{subtitle}
else if docType
h2.hero-subtitle #{renamer(capitalize(docType))}
if current.path[3] == 'api' && current.path[1] == 'dart'
block breadcrumbs