|
21 | 21 |
|
22 | 22 | <title>{{title}}</title> |
23 | 23 |
|
24 | | - <!-- Bootstrap core CSS --> |
25 | | - <link href="{{base_url}}css/bootstrap.min.css" rel="stylesheet"> |
26 | | - |
27 | 24 | <!-- Custom fonts for this template --> |
28 | 25 | <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap" rel="stylesheet"> |
| 26 | + <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap" rel="stylesheet"> |
| 27 | + <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400&display=swap" rel="stylesheet"> |
| 28 | + |
| 29 | + <!-- Bootstrap core CSS --> |
| 30 | + <link href="{{base_url}}css/bootstrap.min.css" rel="stylesheet"> |
29 | 31 |
|
30 | 32 | <!-- Custom styles for this template --> |
31 | 33 | <link href="{{base_url}}css/docs.css" rel="stylesheet"> |
|
49 | 51 | <!-- End Google Tag Manager --> |
50 | 52 |
|
51 | 53 | <script async defer src="https://buttons.github.io/buttons.js"></script> |
| 54 | + <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 55 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
52 | 56 |
|
53 | 57 | </head> |
54 | 58 |
|
|
58 | 62 | height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> |
59 | 63 | <!-- End Google Tag Manager (noscript) --> |
60 | 64 |
|
61 | | - <div class='k-page'> |
62 | | - |
63 | | - <div class="k-nav" id="nav-menu"> |
64 | | - <a href='{{base_url}}'><img src='{{base_url}}img/logo-small.png' class='logo-small' /></a> |
65 | | - |
66 | | - <div class="nav flex-column nav-pills" role="tablist" aria-orientation="vertical"> |
67 | | - |
68 | | - {% for item in nav %} |
69 | | - <a class="nav-link{% if item.active %} active{% endif %}" href="{{item.url}}" role="tab" aria-selected="{{item.selected}}">{{item.title}}</a> |
70 | | - {% if item.active %} |
71 | | - {% for child in item.children %} |
72 | | - <a class="nav-sublink{% if child.active %} active{% endif %}" href="{{child.url}}">{{child.title}}</a> |
73 | | - {% if child.active %} |
74 | | - {% for grandchild in child.children %} |
75 | | - <a class="nav-sublink2{% if grandchild.active %} active{% endif %}" href="{{grandchild.url}}">{{grandchild.title}}</a> |
76 | | - {% endfor %} |
77 | | - {% endif %} |
| 65 | + <div class="k-page"> |
| 66 | + <div class="hidden"> |
| 67 | + {% set related_nav_urls_map = { |
| 68 | + "/api/": ["/2.18/api/"], |
| 69 | + "/2.18/api/": ["/api/"], |
| 70 | + } %} |
| 71 | + {% set vars = {'related_urls': [], 'active_url': ''} %} |
| 72 | + {% for item in nav %} |
| 73 | + {% if item.active %} |
| 74 | + {{ vars.update({'related_urls': related_nav_urls_map[item.url], 'active_url': item.url}) }} |
| 75 | + {% endif %} |
| 76 | + {% endfor %} |
| 77 | + </div> |
| 78 | + <nav class="nav__container"> |
| 79 | + <div class="nav__wrapper"> |
| 80 | + <div class="nav__controls--mobile"> |
| 81 | + <button class="nav__menu--button"><i class="icon--menu"></i></button> |
| 82 | + <button class="nav__menu--close"><i class="icon--close"></i></button> |
| 83 | + <a href="{{base_url}}"> |
| 84 | + <img class="nav__logo nav__logo--mobile" src="{{base_url}}img/k-logo.png" /> |
| 85 | + </a> |
| 86 | + <button class="nav__search--mobile"> |
| 87 | + <i class="icon__search--mobile"></i> |
| 88 | + </button> |
| 89 | + </div> |
| 90 | + <form class="nav__search nav__search-form--mobile"> |
| 91 | + <input |
| 92 | + class="nav__search--input" |
| 93 | + type="search" |
| 94 | + placeholder="SEARCH" |
| 95 | + aria-label="Search" |
| 96 | + /> |
| 97 | + <button class="nav__search--button" type="submit"> |
| 98 | + <i class="icon--search"></i> |
| 99 | + </button> |
| 100 | + </form> |
| 101 | + <div class="k-nav nav__mobile-menu" id="nav-menu"> |
| 102 | + <!-- version with just the active item visible --> |
| 103 | + <div class="nav flex-column nav-pills" role="tablist" aria-orientation="vertical"> |
| 104 | + {% for item in nav %} |
| 105 | + <a class="nav-link{% if item.active %} active{% endif %}" href="{{item.url}}" role="tab" aria-selected="{{item.selected}}">{{item.title}}</a> |
| 106 | + {% if item.active %} |
| 107 | + {% for child in item.children %} |
| 108 | + <a class="nav-sublink{% if child.active %} active{% endif %}" href="{{child.url}}">{{child.title}}</a> |
| 109 | + {% if child.active %} |
| 110 | + {% for grandchild in child.children %} |
| 111 | + <a class="nav-sublink2{% if grandchild.active %} active{% endif %}" href="{{grandchild.url}}">{{grandchild.title}}</a> |
| 112 | + {% endfor %} |
| 113 | + {% endif %} |
| 114 | + {% endfor %} |
| 115 | + {% endif %} |
78 | 116 | {% endfor %} |
79 | | - {% endif %} |
80 | | - {% endfor %} |
81 | | - |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + |
| 120 | + <a href="{{base_url}}"> |
| 121 | + <img class="nav__logo nav__logo--desktop" src="{{base_url}}img/logo.png" alt="keras.io logo" /> |
| 122 | + </a> |
| 123 | + <div class="nav__menu"> |
| 124 | + {% set main_nav_items = { |
| 125 | + '/getting_started/': 'Get started', |
| 126 | + '/guides/': 'Guides', |
| 127 | + '/api/': 'API Docs', |
| 128 | + '/examples/': 'Examples', |
| 129 | + '/keras_tuner/': 'Keras Tuner', |
| 130 | + '/keras_hub/': 'Keras Hub', |
| 131 | + } %} |
| 132 | + <ul class="nav__item--container"> |
| 133 | + {% for key, value in main_nav_items.items() %} |
| 134 | + <li class="nav__item"> |
| 135 | + <a class="nav__link{% if key == vars['active_url'] or key in vars['related_urls'] %} nav__link--active{% endif %}" href="{{ key }}">{{ value }}</a> |
| 136 | + </li> |
| 137 | + {% endfor %} |
| 138 | + </ul> |
| 139 | + |
| 140 | + <form class="nav__search"> |
| 141 | + <input |
| 142 | + class="nav__search--input" |
| 143 | + type="search" |
| 144 | + placeholder="SEARCH" |
| 145 | + aria-label="Search" |
| 146 | + /> |
| 147 | + <button class="nav__search--button" type="submit"> |
| 148 | + <i class="icon--search"></i> |
| 149 | + </button> |
| 150 | + </form> |
| 151 | + </div> |
| 152 | + </div> |
| 153 | + </nav> |
| 154 | + |
| 155 | + <div class="page__container flex__container"> |
| 156 | + <div class="nav__side-nav" id="nav-menu"> |
| 157 | + <div class="nav flex-column nav-pills" role="tablist" aria-orientation="vertical"> |
| 158 | + {% for item in nav %} |
| 159 | + {% if (item.active and item.children|length > 0) or item.url in vars['related_urls'] %} |
| 160 | + <a class="nav-link{% if item.active %} active{% endif %}" href="{{item.url}}" role="tab" aria-selected="{{item.selected}}"> |
| 161 | + {{item.title}} |
| 162 | + </a> |
| 163 | + {% if item.active and item.children|length > 0 %} |
| 164 | + <div class="nav-expanded-panel"> |
| 165 | + {% for child in item.children %} |
| 166 | + <a class="nav-sublink{% if child.active %} active{% endif %}" href="{{child.url}}">{{child.title}}</a> |
| 167 | + {% if child.active %} |
| 168 | + {% for grandchild in child.children %} |
| 169 | + <a class="nav-sublink2{% if grandchild.active %} active{% endif %}" href="{{grandchild.url}}">{{grandchild.title}}</a> |
| 170 | + {% endfor %} |
| 171 | + {% endif %} |
| 172 | + {% endfor %} |
| 173 | + </div> |
| 174 | + {% endif %} |
| 175 | + {% endif %} |
| 176 | + {% endfor %} |
| 177 | + </div> |
| 178 | + </div> |
| 179 | + <div class="k-main"> |
| 180 | + {{main}} |
82 | 181 | </div> |
83 | | - |
84 | | - </div> |
85 | | - |
86 | | - <div class='k-main'> |
87 | | - {{main}} |
88 | 182 | </div> |
89 | | - |
90 | 183 | </div> |
91 | | - |
| 184 | + <footer> |
| 185 | + <div class="footer__container"> |
| 186 | + <a href="https://policies.google.com/terms">Terms</a> |
| 187 | + <div>|</div> |
| 188 | + <a href="https://policies.google.com/privacy">Privacy</a> |
| 189 | + </div> |
| 190 | + </footer> |
| 191 | + <script src="{{base_url}}js/index.js"></script> |
92 | 192 | </body> |
93 | 193 |
|
94 | | -<footer style="float: left; width: 100%; padding: 1em; border-top: solid 1px #bbb;"> |
95 | | - <a href="https://policies.google.com/terms">Terms</a> | <a href="https://policies.google.com/privacy">Privacy</a> |
96 | | -</footer> |
97 | | - |
98 | 194 | </html> |
0 commit comments