gabrielgio.me @ abdfc394b1af6cb321bb8e2b021912ff4f861936

 1<!DOCTYPE html>
 2<html lang="{{ .Site.LanguageCode | default "en-us" }}">
 3    <head>
 4        <meta charset="UTF-8">
 5        <meta name="viewport" content="width=device-width, initial-scale=1">
 6        <meta http-equiv="X-UA-Compatible" content="IE=edge">
 7
 8        {{ with .Site.Params.favicon }}<link rel="icon" type="image/png" href="{{ . }}" />{{ end }}
 9
10        <title itemprop="name">{{ .Title }} | {{ .Site.Params.description }}</title>
11        {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
12        {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
13
14        {{ $styles := resources.Get "scss/main.scss" | resources.ToCSS | minify | fingerprint}}
15        <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
16        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
17
18        {{ with .OutputFormats.Get "RSS" -}}
19        {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
20        {{- end }}
21
22        <!-- Meta tags -->
23        {{ partial "meta" . }}
24    </head>
25    <body>
26        <div class="layout">
27            {{ partial "header" . }}
28            {{ block "main" . }}{{ end }}
29            {{ partial "footer" . }}
30        </div>
31    </body>
32
33    <script>
34     // TODO
35     // Use Hugo templating to achieve this
36     // Script to check active nav menu
37     (function() {
38         const links = document.querySelectorAll("nav a")
39         const currentUrl = location.href
40
41         for (const link of links) {
42             if (location.href.split("/").length === 4 && link.href.endsWith("/posts/")) {
43                 link.classList.add("active-link")
44                 break;
45             }
46
47             if (link.href === currentUrl) {
48                 link.classList.add("active-link")
49             }
50         }
51     }())
52    </script>
53
54</html>