|
1 |
| -{{ content }} |
| 1 | +<!doctype html> |
| 2 | +<html xml:lang="en" lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
| 8 | + <!-- Based on http://stackoverflow.com/questions/2268204/favicon-dimensions: 32x32 is the last icon, since Firefox uses the last one. IE requires that I convert .bmp to .ico - it's not enough to rename it, otherwise it won't show up in IE tab. So I used http://image.online-convert.com/convert-to-ico --> |
| 9 | + <link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16"> |
| 10 | + <link rel="icon" type="image/png" href="favicon-64x64.png" sizes="64x64"> |
| 11 | + <link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32"> |
| 12 | + {% comment %} For highlighting the current menu & current menu item in Bootstrap menu. |
| 13 | + page.url ends with .html (whether on GitHub and in Jekyll), so I treat it. |
| 14 | + The following has to be in three expressions, rather than in one complex expression - otherwise it failed. |
| 15 | + {% endcomment %} |
| 16 | +{% if page.rss != null %} |
| 17 | + <link rel="alternate" type="application/rss+xml" title="RSS feed" href="{{ page.rss }}"/> |
| 18 | +{% else %} |
| 19 | + <link href="https://github.com/daisydiff/daisydiff.github.io/commits/master.atom" rel="alternate" title="DaisyDiff Documentation updates" type="application/atom+xml"> |
| 20 | +{% endif %} |
| 21 | +{% assign pageNameParts = (page.url | split: '/') %} |
| 22 | +{% assign pageNamePartsWithoutSlash = (pageNameParts[1] | split: '.html') %} |
| 23 | + |
| 24 | +{% assign pageName= pageNamePartsWithoutSlash[0] %} |
| 25 | +{% assign pageNameInTitleBar= pageName %} |
| 26 | + |
| 27 | +{% comment %} For some reason, pageName=="index" didn't evaluate to true. TODO report {% endcomment %} |
| 28 | +{% if pageName == null or pageName contains "index" and "index" contains pageName %} |
| 29 | + {% assign pageName = './' %} |
| 30 | + {% assign pageNameInTitleBar= 'Overview' %} |
| 31 | +{% endif %} |
| 32 | + {% capture pageNameInTitleBar %}{{pageNameInTitleBar}}{% if page.title != null %} {{ page.title }}{% endif %}{% endcapture %} |
| 33 | + <title>DaisyDiff > {{pageNameInTitleBar}}</title> |
| 34 | + <!-- Latest compiled and minified CSS --> |
| 35 | + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> |
| 36 | + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"> |
| 37 | + <style type="text/css"> |
| 38 | + /* Based on http://getbootstrap.com/css/#grid-media-queries - @screen-sm-min */ |
| 39 | + @media (max-width: 767px) { |
| 40 | + #toc-desktop-button {display: none;} |
| 41 | + } |
| 42 | + @media (min-width: 768px) { |
| 43 | + #toc-mobile-button {display: none;} |
| 44 | + /* Mobiles browsers don't show favicon and title when scrolling down, so let's show both in Bootstrap toolbar (i.e. shown even when Bootstrap menu is vertically collapsed). However, desktop browsers show favicon and title most of the time; also, we don't want favicon and the title in Bootstrap toolbar on desktops, since then there's less space for the menu to show horizontally, which causes the menu to be split across two lines. */ |
| 45 | + #toc-mobile-title {display: none;} |
| 46 | + } |
| 47 | + ul.nav > li > a { |
| 48 | + padding-left: 2px; |
| 49 | + padding-right: 2px; |
| 50 | + } |
| 51 | + .dropdown-menu[data-placement="left"] { |
| 52 | + left: auto; |
| 53 | + right: 0px; |
| 54 | + } |
| 55 | + /* Following, and the respective data-placement="left" in _includes/toc.md, is from https://github.com/twbs/bootstrap/issues/1411 */ |
| 56 | + .navbar .nav>li>.dropdown-menu[data-placement="left"]:before { |
| 57 | + left: auto; |
| 58 | + right: 9px; |
| 59 | + } |
| 60 | + |
| 61 | + .navbar .nav > li > .dropdown-menu[data-placement="left"]:after { |
| 62 | + left: auto; |
| 63 | + right: 10px; |
| 64 | + } |
| 65 | + |
| 66 | + #markdown-toc-mobile, #markdown-toc-desktop { |
| 67 | + /* From bootstrap.min.css */ |
| 68 | + border: 1px solid rgba(0, 0, 0, 0.15); |
| 69 | + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.176); |
| 70 | + } |
| 71 | + |
| 72 | + /* Following rules use specific selectors, so that they override bootstrap.min.css. */ |
| 73 | + /* Highlight the menu that contains a link to the current page. This has to use custom data-child-urls, since there's no way to make a CSS selector depend on the next element(s) - e.g. the following didn't work: |
| 74 | + .dropdown-menu > li > a[href^="{{ pageName }}"] ::before ul a {color: green;} |
| 75 | + */ |
| 76 | + .navbar-default .navbar-nav > li a[data-group-page-names~="{{ pageName }}"] {color: green;} |
| 77 | + |
| 78 | + /* Highlight the menu item that is the current page. The selector is complex, so that it overrides a rule from bootstrap.min.css when in mobile mode */ |
| 79 | + .navbar-default .navbar-nav .open ul.dropdown-menu > li > a[href="{{ pageName }}"] {color: green;} |
| 80 | + /* Only until Jekyll 3 is common. TODO remove then: */ |
| 81 | + .navbar-default .navbar-nav .open ul.dropdown-menu > li > a[href="{{ pageName }}.html"] {color: green;} |
| 82 | + |
| 83 | + /* Override bootstrap.min.css: */ |
| 84 | + * code { color: black; } |
| 85 | + |
| 86 | + #navbar-menu .navbar-nav > li > a { |
| 87 | + padding-bottom: 2px; |
| 88 | + padding-top: 2px; |
| 89 | + } |
| 90 | + body .navbar { |
| 91 | + margin-bottom: 2px; |
| 92 | + min-height: 18px; |
| 93 | + } |
| 94 | + p#toc-mobile-title.navbar-text { |
| 95 | + padding: 0px; |
| 96 | + margin-top: 0px; |
| 97 | + margin-bottom: 0px; |
| 98 | + } |
| 99 | + .navbar |
| 100 | + { |
| 101 | + height:unset !important; |
| 102 | + } |
| 103 | + .navbar-header |
| 104 | + { |
| 105 | + min-height:16px !important; |
| 106 | + } |
| 107 | + button.navbar-toggle { |
| 108 | + padding: 0px; |
| 109 | + margin-top: 0px; |
| 110 | + margin-bottom: 0px; |
| 111 | + } |
| 112 | + </style> |
| 113 | + <script type="text/javascript"> |
| 114 | + // Based on https://github.com/twbs/bootstrap/issues/1768: |
| 115 | + function shiftWindow() { |
| 116 | + scrollBy( 0, -1*$("#whole-navbar").height() ); |
| 117 | + } |
| 118 | + window.addEventListener("hashchange", shiftWindow); |
| 119 | + |
| 120 | + function load() { |
| 121 | + $('body').css( "padding-top", $("#whole-navbar").height() ); |
| 122 | + if (window.location.hash) { |
| 123 | + shiftWindow(); |
| 124 | + } |
| 125 | + $( '#markdown-toc' ).appendTo( '#toc-mobile-div' ); |
| 126 | + $( '#markdown-toc' ).clone().appendTo( '#toc-desktop-div' ); |
| 127 | + |
| 128 | + // After clicking at a link from toc.md, collapse the whole expanded menu (on mobile) or collapse TOC (on desktop) |
| 129 | + $( "#toc-mobile-div a" ).click( |
| 130 | + function() { |
| 131 | + $("#navbar-menu").toggleClass("in"); |
| 132 | + } |
| 133 | + ); |
| 134 | + $( "#toc-desktop-div a" ).click( |
| 135 | + function() { |
| 136 | + $("#toc-desktop-div").toggleClass("in"); |
| 137 | + } |
| 138 | + ); |
| 139 | + } |
| 140 | + |
| 141 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| 142 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| 143 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 144 | + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| 145 | + ga('create', 'UA-62560081-1', 'auto'); |
| 146 | + ga('send', 'pageview'); |
| 147 | + </script> |
| 148 | + </head> |
| 149 | + <body onload="load()"> |
| 150 | +<!-- Based on http://getbootstrap.com/examples/navbar-fixed-top/ --> |
| 151 | +<nav class="navbar navbar-default navbar-fixed-top"> |
| 152 | + <div class="container-fluid" id="whole-navbar"> |
| 153 | + <!-- Brand and toggle get grouped for better mobile display --> |
| 154 | + <div class="navbar-header"> |
| 155 | + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-menu"> |
| 156 | + <span class="sr-only">Toggle navigation</span> |
| 157 | + <span class="icon-bar"></span> |
| 158 | + <span class="icon-bar"></span> |
| 159 | + <span class="icon-bar"></span> |
| 160 | + </button> |
| 161 | + <p class="navbar-text" id="toc-mobile-title" data-toggle="collapse" data-target="#navbar-menu"><img alt="DaisyDiff logo" src="favicon-16x16.png" width="16" height="16"/> {{ pageNameInTitleBar }}</p> |
| 162 | + </div> |
| 163 | + |
| 164 | + <!-- Collect the nav links, forms, and other content for toggling --> |
| 165 | + <div class="collapse navbar-collapse" id="navbar-menu"> |
| 166 | + <ul class="nav navbar-nav"> |
| 167 | + <li id="toc-mobile-button"><a data-toggle="collapse" href="#toc-mobile-div" class="dropdown-toggle" role="button"><em>This page</em><span class="caret"></span></a> |
| 168 | + <div id="toc-mobile-div" class="collapse"> |
| 169 | + </div> |
| 170 | + </li> |
| 171 | + <li id="toc-desktop-button"><a data-toggle="collapse" href="#toc-desktop-div" class="dropdown-toggle" role="button"><em>This page</em><span class="caret"></span></a> |
| 172 | + </li> |
| 173 | + {% include toc.md asBootstrapMenu="true" %} |
| 174 | + </ul> |
| 175 | + </div><!-- /.navbar-collapse --> |
| 176 | + <div id="toc-desktop-div" class="collapse"> |
| 177 | + </div> |
| 178 | + </div><!-- /.container-fluid --> |
| 179 | +</nav> |
| 180 | + {{ content }} |
| 181 | +<!-- Based on http://getbootstrap.com/components/#navbar --> |
| 182 | + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> |
| 183 | + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> |
| 184 | + </body> |
| 185 | +</html> |
0 commit comments