|
1 | 1 | <!DOCTYPE html> |
2 | | -<html> |
| 2 | +<html lang="en"> |
3 | 3 | <head> |
4 | | - <meta charset='utf-8'> |
5 | | - <meta http-equiv="X-UA-Compatible" content="chrome=1"> |
6 | | - <link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'> |
7 | | - <link rel="stylesheet" type="text/css" href="/css/stylesheet.css" media="screen" /> |
8 | | - <link rel="stylesheet" type="text/css" href="/css/github.css" media="screen" /> |
9 | | - <link rel="stylesheet" type="text/css" href="/css/custom.css" media="screen" /> |
10 | | - <link rel="stylesheet" type="text/css" href="/css/print.css" media="print" /> |
11 | | - <!--[if lt IE 9]> |
12 | | - <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
13 | | - <![endif]--> |
14 | | - <title>./databyte / {{ page.title }}</title> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <!-- Without this, phones fall back to a 980px layout viewport, the |
| 6 | + max-width:767px breakpoint never fires, and the page renders at ~38%. --> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 8 | + |
| 9 | + {% assign has_title = false %} |
| 10 | + {% if page.title and page.title != '' %}{% assign has_title = true %}{% endif %} |
| 11 | + {% if has_title %} |
| 12 | + <title>{{ page.title | strip_html }} · ./databyte</title> |
| 13 | + {% else %} |
| 14 | + <title>./databyte · David Sommers</title> |
| 15 | + {% endif %} |
| 16 | + |
| 17 | + {% assign desc = page.description | default: site.description %} |
| 18 | + <meta name="description" content="{{ desc | strip_html | strip_newlines | truncate: 160 }}"> |
| 19 | + <link rel="canonical" href="{{ page.url | absolute_url }}"> |
| 20 | + |
| 21 | + <meta property="og:type" content="{% if page.date %}article{% else %}website{% endif %}"> |
| 22 | + <meta property="og:title" content="{% if has_title %}{{ page.title | strip_html }}{% else %}./databyte{% endif %}"> |
| 23 | + <meta property="og:description" content="{{ desc | strip_html | strip_newlines | truncate: 160 }}"> |
| 24 | + <meta property="og:url" content="{{ page.url | absolute_url }}"> |
| 25 | + <meta property="og:site_name" content="./databyte"> |
| 26 | + <meta name="twitter:card" content="summary"> |
| 27 | + <meta name="twitter:creator" content="@databyte"> |
| 28 | + |
| 29 | + <!-- Set the theme before first paint so a dark-mode reader never sees a |
| 30 | + white flash. Must stay inline and above the stylesheet. --> |
| 31 | + <script> |
| 32 | + (function () { |
| 33 | + try { |
| 34 | + var t = localStorage.getItem('theme'); |
| 35 | + if (t === 'light' || t === 'dark') { |
| 36 | + document.documentElement.setAttribute('data-theme', t); |
| 37 | + } |
| 38 | + } catch (e) {} |
| 39 | + })(); |
| 40 | + </script> |
| 41 | + |
| 42 | + <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 43 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 44 | + <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Chivo:wght@700;900&display=swap"> |
| 45 | + <link rel="stylesheet" href="{{ '/css/main.css' | relative_url }}"> |
| 46 | + |
| 47 | + <link rel="icon" href="{{ '/favicon.svg' | relative_url }}" type="image/svg+xml"> |
| 48 | + {% feed_meta %} |
15 | 49 | </head> |
16 | 50 |
|
17 | 51 | <body> |
18 | | - <div id="container"> |
19 | | - <div class="inner"> |
20 | | - <header> |
21 | | - <h1><a href="/">./databyte</a></h1> |
22 | | - <h2></h2> |
23 | | - </header> |
| 52 | + <a class="skip-link" href="#main">Skip to content</a> |
24 | 53 |
|
25 | | - <hr/> |
| 54 | + <div class="wrap"> |
| 55 | + <header class="site-header"> |
| 56 | + <a class="wordmark" href="{{ '/' | relative_url }}">./databyte</a> |
26 | 57 |
|
27 | | - <section id="main_content"> |
28 | | - <h3>{{ page.title }}</h3> |
| 58 | + <button class="theme-toggle" type="button" id="theme-toggle" |
| 59 | + aria-label="Switch between light and dark theme"> |
| 60 | + <svg class="icon-moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" |
| 61 | + fill="none" stroke="currentColor" stroke-width="2" |
| 62 | + stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> |
| 63 | + <path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/> |
| 64 | + </svg> |
| 65 | + <svg class="icon-sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" |
| 66 | + fill="none" stroke="currentColor" stroke-width="2" |
| 67 | + stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> |
| 68 | + <circle cx="12" cy="12" r="4"/> |
| 69 | + <path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/> |
| 70 | + </svg> |
| 71 | + </button> |
| 72 | + </header> |
29 | 73 |
|
30 | | - {{ content }} |
31 | | - </section> |
| 74 | + <main class="site-main" id="main"> |
| 75 | + {{ content }} |
| 76 | + </main> |
32 | 77 |
|
33 | | - <footer> |
34 | | - by David Sommers. Tweet me <a href="https://twitter.com/databyte">@databyte</a>. Tactile theme by <a href="http://twitter.com/jasonlong">Jason Long</a>. |
35 | | - </footer> |
36 | | - </div> |
| 78 | + <footer class="site-footer"> |
| 79 | + <span>by David Sommers · <a href="https://twitter.com/databyte">@databyte</a></span> |
| 80 | + <a href="{{ '/feed.xml' | relative_url }}">RSS</a> |
| 81 | + </footer> |
37 | 82 | </div> |
38 | 83 |
|
39 | | - <script type="text/javascript"> |
40 | | - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
41 | | - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
42 | | - </script> |
43 | | - <script type="text/javascript"> |
44 | | - try { |
45 | | - var pageTracker = _gat._getTracker("UA-12936734-2"); |
46 | | - pageTracker._trackPageview(); |
47 | | - } catch(err) {} |
| 84 | + <script> |
| 85 | + (function () { |
| 86 | + var btn = document.getElementById('theme-toggle'); |
| 87 | + if (!btn) return; |
| 88 | + var root = document.documentElement; |
| 89 | + btn.addEventListener('click', function () { |
| 90 | + // Resolve what's on screen now: an explicit override if one is set, |
| 91 | + // otherwise whatever the OS is currently giving us. |
| 92 | + var current = root.getAttribute('data-theme'); |
| 93 | + if (!current) { |
| 94 | + current = window.matchMedia('(prefers-color-scheme: dark)').matches |
| 95 | + ? 'dark' : 'light'; |
| 96 | + } |
| 97 | + var next = current === 'dark' ? 'light' : 'dark'; |
| 98 | + root.setAttribute('data-theme', next); |
| 99 | + try { localStorage.setItem('theme', next); } catch (e) {} |
| 100 | + }); |
| 101 | + })(); |
48 | 102 | </script> |
49 | 103 | </body> |
50 | 104 | </html> |
0 commit comments