| 1 | {{define "base.html"}}<!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <title>{{block "title" .}}{{.BlogTitle}}{{end}}</title> |
| 7 | {{if .FaviconURL}} |
| 8 | <link rel="apple-touch-icon" sizes="180x180" href="{{.FaviconURL}}"> |
| 9 | <link rel="icon" type="image/png" sizes="32x32" href="{{.FaviconURL}}"> |
| 10 | <link rel="icon" type="image/png" sizes="16x16" href="{{.FaviconURL}}"> |
| 11 | {{else}} |
| 12 | <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png"> |
| 13 | <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png"> |
| 14 | <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png"> |
| 15 | <link rel="manifest" href="/static/site.webmanifest"> |
| 16 | {{end}} |
| 17 | <meta name="theme-color" content="#121113" /> |
| 18 | {{block "meta" .}}{{end}} |
| 19 | <link rel="stylesheet" href="/assets/darkmatter.css"> |
| 20 | <link rel="stylesheet" href="/static/styles.css"> |
| 21 | <link rel="stylesheet" href="/custom-styles.css"> |
| 22 | </head> |
| 23 | <body> |
| 24 | {{if .HeaderHTML}} |
| 25 | <div class="custom-header"> |
| 26 | {{.HeaderHTML}} |
| 27 | </div> |
| 28 | {{end}} |
| 29 | <header class="header"> |
| 30 | <a href="/" class="logo">{{.BlogTitle}}</a> |
| 31 | <nav class="links"> |
| 32 | {{range .NavLinks}} |
| 33 | <a href="{{.URL}}">{{.Label}}</a> |
| 34 | {{end}} |
| 35 | </nav> |
| 36 | </header> |
| 37 | <main> |
| 38 | {{block "content" .}}{{end}} |
| 39 | </main> |
| 40 | <footer class="footer"> |
| 41 | {{.FooterHTML}} |
| 42 | </footer> |
| 43 | <script> |
| 44 | document.querySelectorAll('.post-date').forEach(el => { |
| 45 | const d = new Date(el.textContent.trim()); |
| 46 | if (!isNaN(d)) { |
| 47 | const day = String(d.getDate()).padStart(2, '0'); |
| 48 | const mon = d.toLocaleString('en-US', { month: 'short' }); |
| 49 | el.textContent = `${day} ${mon}, ${d.getFullYear()}`; |
| 50 | } |
| 51 | }); |
| 52 | </script> |
| 53 | </body> |
| 54 | </html>{{end}} |