1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 16:05:31 -04:00

minify HTML on build

This commit is contained in:
2019-11-22 16:23:45 -05:00
parent 7887aeb6ed
commit cf3e2ca5cf
17 changed files with 248 additions and 180 deletions

View File

@@ -1,5 +1,5 @@
<footer>
<div id="copyright">Posts licensed under <a class="no-underline" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International" target="_blank" rel="noopener noreferrer nofollow">CC-BY-4.0</a>, <a class="no-underline" href="{{ .Site.Params.wayback }}" title="View Old Versions on Wayback Machine" id="wayback" target="_blank" rel="noopener noreferrer nofollow">{{ .Site.Params.copyrightFirstYear }} &ndash;</a> {{ now.Format "2006" }}.</div>
<div id="panda"><a class="no-underline" href="https://nationalzoo.si.edu/webcams/panda-cam" title="Live Panda Party!!!11" target="_blank" rel="noopener noreferrer nofollow"><span>&#x1F43C;</span></a></div>
<div id="poweredby"><a class="no-underline" href="https://gohugo.io/" title="Powered by Hugo" id="hugo" target="_blank" rel="noopener noreferrer nofollow">Powered by Hugo.</a> <a class="no-underline" href="{{ .Site.Params.gitRepo }}" title="View Source on GitHub" id="source" target="_blank" rel="noopener noreferrer">View source.</a></div>
</footer>
<footer>
<div id="copyright">Posts licensed under <a class="no-underline" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International" target="_blank" rel="noopener noreferrer nofollow">CC-BY-4.0</a>, <a class="no-underline" href="{{ .Site.Params.wayback }}" title="View Old Versions on Wayback Machine" id="wayback" target="_blank" rel="noopener noreferrer nofollow">{{ .Site.Params.copyrightFirstYear }} &ndash;</a> {{ now.Format "2006" }}.</div>
<div id="panda"><a class="no-underline" href="https://nationalzoo.si.edu/webcams/panda-cam" title="Live Panda Party!!!11" target="_blank" rel="noopener noreferrer nofollow"><span>&#x1F43C;</span></a></div>
<div id="poweredby"><a class="no-underline" href="https://gohugo.io/" title="Powered by Hugo" id="hugo" target="_blank" rel="noopener noreferrer nofollow">Powered by Hugo.</a> <a class="no-underline" href="{{ .Site.Params.gitRepo }}" title="View Source on GitHub" id="source" target="_blank" rel="noopener noreferrer">View source.</a></div>
</footer>

View File

@@ -1,14 +1,14 @@
<header>
<nav>
<a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" title="{{ .Site.Title }}" aria-label="{{ .Site.Title }}">
{{ partial "logo.html" . }}
<span id="name">{{ .Site.Title }}</span>
</a>
<ul>
<li><a class="no-underline" href="{{ .Site.BaseURL }}" title="Home">&#x1F3E0;</a></li>
<li><a class="no-underline" href="{{ "notes/" | absURL }}" title="Notes">&#x1F4DD;</a></li>
<li><a class="no-underline" href="https://github.com/{{ .Site.Author.github }}" title="GitHub" target="_blank" rel="me noopener noreferrer">&#x1F468;&#x200D;&#x1F4BB;</a></li>
<li><a class="no-underline" href="&#x6D;&#x61;&#x69;&#x6C;&#x74;&#x6F;&#x3A;&#x6A;&#x61;&#x6B;&#x65;&#x40;&#x6A;&#x61;&#x72;&#x76;&#x2E;&#x69;&#x73;" title="Email Me">&#x1F48C;</a></li>
</ul>
</nav>
</header>
<header>
<nav>
<a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" title="{{ .Site.Title }}" aria-label="{{ .Site.Title }}">
{{ partial "logo.html" . }}
<span id="name">{{ .Site.Title }}</span>
</a>
<ul>
<li><a class="no-underline" href="{{ .Site.BaseURL }}" title="Home">&#x1F3E0;</a></li>
<li><a class="no-underline" href="{{ "notes/" | absURL }}" title="Notes">&#x1F4DD;</a></li>
<li><a class="no-underline" href="https://github.com/{{ .Site.Author.github }}" title="GitHub" target="_blank" rel="me noopener noreferrer">&#x1F468;&#x200D;&#x1F4BB;</a></li>
<li><a class="no-underline" href="&#x6D;&#x61;&#x69;&#x6C;&#x74;&#x6F;&#x3A;&#x6A;&#x61;&#x6B;&#x65;&#x40;&#x6A;&#x61;&#x72;&#x76;&#x2E;&#x69;&#x73;" title="Email Me">&#x1F48C;</a></li>
</ul>
</nav>
</header>

View File

@@ -1,2 +1,2 @@
<div id="commento"></div>
<script src="https://comments.jarv.is/js/commento.js"></script>
<script src="https://comments.jarv.is/js/commento.js"></script>

View File

@@ -8,12 +8,12 @@
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta name="author" content="{{ .Site.Author.name }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ partial "open-graph.html" . }}
{{ partial "open-graph.html" . }}
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="{{ .Site.Title }}">
<meta name="theme-color" content="#0e6dc2">
{{- $style := resources.Get "sass/main.scss" | resources.ToCSS (dict "targetPath" "style.css" "outputStyle" "compact") }}
{{- $style := resources.Get "sass/main.scss" | resources.ToCSS (dict "targetPath" "style.css" "outputStyle" "compact") }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}">
<link rel="mask-icon" href="{{ "safari-pinned-tab.svg" | absURL }}" color="#009cdf">
@@ -23,10 +23,10 @@
<link rel="icon" href="{{ "favicon-16.png" | absURL }}" sizes="16x16">
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL }}">
<link rel="canonical" href="{{ .Permalink }}">
{{- if and (eq .Type "notes") (eq .Kind "page") }}{{ with .OutputFormats.Get "amp" }}
<link rel="amphtml" href="{{ .Permalink }}">
{{- end }}{{ end }}
{{- if and (eq .Type "notes") (eq .Kind "page") }}{{ with .OutputFormats.Get "amp" }}
<link rel="amphtml" href="{{ .Permalink }}">
{{- end }}{{ end }}
<link rel="alternate" type="application/rss+xml" href="{{ "index.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
<link rel="author" href="{{ "humans.txt" | absURL }}">
</head>
<body id="{{ .Type }}">
<body id="{{ .Type }}">

View File

@@ -1,15 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 144.1" width="30" height="45">
<g id="c1" fill="#6fbc4e">
<polygon points="57.6 0 38.4 11.1 38.4 11.1 76.8 33.2 96 22.1 96 22.1 57.6 0 57.6 0"/>
<polygon points="19.2 66.5 0 77.6 0 77.6 19.2 88.7 38.4 77.6 38.4 77.6 19.2 66.5 19.2 66.5"/>
<polygon points="57.6 88.7 19.2 110.9 19.2 110.9 38.4 121.9 76.8 99.8 76.8 99.8 57.6 88.7 57.6 88.7"/>
</g>
<g id="c2" fill="#ffb900">
<polygon points="38.4 11.1 38.4 33.3 57.6 44.3 57.6 88.7 76.8 99.8 76.8 33.2 38.4 11.1 38.4 11.1"/>
<polygon points="19.2 110.9 19.2 110.8 19.2 88.7 0 77.6 0 121.9 38.4 144.1 38.4 121.9 19.2 110.9 19.2 110.9"/>
</g>
<g id="c3" fill="#009cdf">
<polygon points="76.8 33.2 76.8 99.8 76.8 99.8 38.4 121.9 38.4 144.1 96 110.9 96 22.1 76.8 33.2 76.8 33.2"/>
<polygon points="19.2 110.9 38.4 99.8 38.4 77.6 19.2 88.7 19.2 110.9 19.2 110.9"/>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 144.1" width="30" height="45">
<g id="c1" fill="#6fbc4e">
<polygon points="57.6 0 38.4 11.1 38.4 11.1 76.8 33.2 96 22.1 96 22.1 57.6 0 57.6 0"/>
<polygon points="19.2 66.5 0 77.6 0 77.6 19.2 88.7 38.4 77.6 38.4 77.6 19.2 66.5 19.2 66.5"/>
<polygon points="57.6 88.7 19.2 110.9 19.2 110.9 38.4 121.9 76.8 99.8 76.8 99.8 57.6 88.7 57.6 88.7"/>
</g>
<g id="c2" fill="#ffb900">
<polygon points="38.4 11.1 38.4 33.3 57.6 44.3 57.6 88.7 76.8 99.8 76.8 33.2 38.4 11.1 38.4 11.1"/>
<polygon points="19.2 110.9 19.2 110.8 19.2 88.7 0 77.6 0 121.9 38.4 144.1 38.4 121.9 19.2 110.9 19.2 110.9"/>
</g>
<g id="c3" fill="#009cdf">
<polygon points="76.8 33.2 76.8 99.8 76.8 99.8 38.4 121.9 38.4 144.1 96 110.9 96 22.1 76.8 33.2 76.8 33.2"/>
<polygon points="19.2 110.9 38.4 99.8 38.4 77.6 19.2 88.7 19.2 110.9 19.2 110.9"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 917 B

View File

@@ -1,26 +1,26 @@
<meta property="og:title" content="{{ .Title }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:type" content="{{ if .IsHome }}website{{ else }}article{{ end }}">
<meta property="og:locale" content="en_US">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta property="og:image" content="{{ if .Params.image }}{{ (printf "%s%s%s" (.OutputFormats.Get "html").Permalink "images/" .Params.image ) }}{{ else }}{{ "me_lg.jpg" | absURL }}{{ end }}">
{{- if .IsPage }}
{{- if not .PublishDate.IsZero }}
<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
{{- else if not .Date.IsZero }}
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
{{- end }}
{{- with .Site.Author.facebook }}
<meta property="article:author" content="https://www.facebook.com/{{ . }}">{{ end }}
{{- with .Params.tags }}{{ range . }}
<meta property="article:tag" content="{{ . }}">{{ end }}{{ end }}
{{- end }}
<meta property="fb:admins" content="{{ .Site.Author.facebook_id }}">
<meta property="fb:app_id" content="{{ .Site.Params.facebook_app_id }}">
<meta name="twitter:card" content="summary">
<meta name="twitter:domain" content="{{ .Site.Params.domain }}">
<meta name="twitter:site" content="{{ .Site.Author.twitter }}">
<meta name="twitter:creator" content="{{ .Site.Author.twitter }}">
<meta name="twitter:dnt" content="on">
<meta name="twitter:widgets:csp" content="on">
<meta property="og:title" content="{{ .Title }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:type" content="{{ if .IsHome }}website{{ else }}article{{ end }}">
<meta property="og:locale" content="en_US">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta property="og:image" content="{{ if .Params.image }}{{ (printf "%s%s%s" (.OutputFormats.Get "html").Permalink "images/" .Params.image ) }}{{ else }}{{ "me_lg.jpg" | absURL }}{{ end }}">
{{- if .IsPage }}
{{- if not .PublishDate.IsZero }}
<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
{{- else if not .Date.IsZero }}
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
{{- end }}
{{- with .Site.Author.facebook }}
<meta property="article:author" content="https://www.facebook.com/{{ . }}">{{ end }}
{{- with .Params.tags }}{{ range . }}
<meta property="article:tag" content="{{ . }}">{{ end }}{{ end }}
{{- end }}
<meta property="fb:admins" content="{{ .Site.Author.facebook_id }}">
<meta property="fb:app_id" content="{{ .Site.Params.facebook_app_id }}">
<meta name="twitter:card" content="summary">
<meta name="twitter:domain" content="{{ .Site.Params.domain }}">
<meta name="twitter:site" content="{{ .Site.Author.twitter }}">
<meta name="twitter:creator" content="{{ .Site.Author.twitter }}">
<meta name="twitter:dnt" content="on">
<meta name="twitter:widgets:csp" content="on">

View File

@@ -1,38 +1,38 @@
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
"headline": {{ .Title }},
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
"dateModified": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
"description": {{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }},
"keywords": "{{ with .Params.tags }}{{ range $index, $tag := . }}{{ if gt $index 0 }}, {{ end }}{{ $tag }}{{ end }}{{ end }}",
"author": {
"@type": "Person",
"name": {{ .Site.Author.name }},
"url": {{ .Site.BaseURL }},
"image": {
"@type": "ImageObject",
"url": {{ "me_lg.jpg" | absURL }},
"width": 920,
"height": 920
}
},
"publisher": {
"@type": "Organization",
"name": {{ .Site.Author.name }},
"url": {{ .Site.BaseURL }},
"logo": {
"@type": "ImageObject",
"url": {{ "favicon-512.png" | absURL }},
"width": 512,
"height": 512
}
},
"image": {
"@type": "ImageObject",
"url": {{ if .Params.image }}{{ (printf "%s%s%s" (.OutputFormats.Get "html").Permalink "images/" .Params.image ) }}{{ else }}{{ "me_lg.jpg" | absURL }}{{ end }}
}
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
"headline": {{ .Title }},
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
"dateModified": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
"description": {{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }},
"keywords": "{{ with .Params.tags }}{{ range $index, $tag := . }}{{ if gt $index 0 }}, {{ end }}{{ $tag }}{{ end }}{{ end }}",
"author": {
"@type": "Person",
"name": {{ .Site.Author.name }},
"url": {{ .Site.BaseURL }},
"image": {
"@type": "ImageObject",
"url": {{ "me_lg.jpg" | absURL }},
"width": 920,
"height": 920
}
},
"publisher": {
"@type": "Organization",
"name": {{ .Site.Author.name }},
"url": {{ .Site.BaseURL }},
"logo": {
"@type": "ImageObject",
"url": {{ "favicon-512.png" | absURL }},
"width": 512,
"height": 512
}
},
"image": {
"@type": "ImageObject",
"url": {{ if .Params.image }}{{ (printf "%s%s%s" (.OutputFormats.Get "html").Permalink "images/" .Params.image ) }}{{ else }}{{ "me_lg.jpg" | absURL }}{{ end }}
}
}
</script>

View File

@@ -1,13 +1,13 @@
<script>
(function(j, a, r, v, i, s){
a[v]=a[v]||function(){
(a[v].q=a[v].q||[]).push(arguments)
};
i=j.createElement('script'),
s=j.getElementsByTagName('script')[0];
i.async=1; i.src=r; i.id='fathom-script';
s.parentNode.insertBefore(i,s)
})(document, window, 'https://s.jarv.is/tracker.js', 'fathom');
fathom('set', 'siteId', 'DYCXU');
fathom('trackPageview');
</script>
<script>
(function(j, a, r, v, i, s){
a[v]=a[v]||function(){
(a[v].q=a[v].q||[]).push(arguments)
};
i=j.createElement('script'),
s=j.getElementsByTagName('script')[0];
i.async=1; i.src=r; i.id='fathom-script';
s.parentNode.insertBefore(i,s)
})(document, window, 'https://s.jarv.is/tracker.js', 'fathom');
fathom('set', 'siteId', 'DYCXU');
fathom('trackPageview');
</script>